Version)… Info : BCM2835 SPI SWD driver Info : SWD only mode enabled Info : clock speed 31200 kHz Should see this message if you’re using the 31 MHz SPI version of OpenOCD (instead of the old GPIO # Select the Broadcom SPI interface for Raspberry Pi (SWD transport) interface bcm2835spi # Set the SPI speed in kHz bcm2835spi_speed 31200 # 31.2 MHzīcm2835spi accepts one parameter bcm2835spi_speed, the SPI speed in kHz. That you select bcm2835spi as the OpenOCD interface (in swd-pi.ocd). GPIO, the SPI interface doesn’t require sudo access. Script: $HOME/ openocd-spi/src/openocd \ -s $HOME/ openocd-spi/tcl \ -f swd-pi.ocd \ -f flash-boot.ocd Sample OpenOCD script and shell script that you may adapt for flashing… You prefer to write your own OpenOCD scripts (instead of using pinetime-rust-mynewt)… Scripts to unprotect the flash ROM, flash the bootloader and flash the application via SPI… cd ~/pinetime-rust-mynewt scripts/nrf52-pi/flash-unprotect.sh scripts/nrf52-pi/flash-boot.sh scripts/nrf52-pi/flash-app.shĭetails may be found the article “ Build and Flash Rust Mynewt Firmware for PineTime Smart Watch ” under the section “Remove PineTime Flash Protection” The openocd folder to openocd-spi like this… $HOME/ openocd-spi/src/openocd \ -s $HOME/ openocd-spi/tcl \ -f scripts/nrf52-pi/swd-pi.ocd \ -f scripts/nrf52/flash-app.ocd OpenOCD scripts located at pinetime-rust-mynewt/scripts/nrf52-pi…įlash-app.sh, flash-boot.sh, flash-unprotect.sh You’re using pinetime-rust-mynewt downloaded from You may download the pre-built openocd-spi That the sub-repository for one of the dependencies jimtcl is fatal: unable to access ' ': Recv failure: Connection reset by peer fatal: clone of ' ' into submodule path '/private/tmp/aa/openocd-spi/jimtcl' failed See this error… Cloning into 'openocd-spi/jimtcl'. Modified OpenOCD executable is now at openocd-spi/src/openocd configure -enable-sysfsgpio -enable-bcm2835spi -enable-cmsis-dap make We’ll study the SWD Register Read/Write operations in a while…Įnable the SPI interface on Raspberry Pi… sudo raspi-configĭownload and build the modified OpenOCD… cd ~ git clone cd openocd-spi. Protocol enables OpenOCD to flash and debug firmware, by reading and writing the debugging registers Why not useĪrticle explains how we did that… By overcoming some interesting bitwise challenges. MHz) with precise clocking and buffering. Raspberry Pi’s Broadcom microcontroller supports Bidirectional SPI (31 Interface ) is implemented as a kernel mode driver with interrupts, so it runs with Inst ead of sending data over GPIO one bit at a time, what if we couldīlast out the data over Raspberry Pi’s SPI interface ? OpenOCD was sending data to nRF52 one bit at a time… Works fine when OpenOCD is the only task running, not when it’s sharing the CPU with VSCode and other interactive tasks!īecause multitasking skews the precise timing that’s needed by OpenOCD to send each bit correctly. That we see above… Debugging nRF52 with a Raspberry Pi running VSCode and OpenOCD… Was impossible just a weekĬonnects to nRF52 for flashing and debugging by running Arm’s SWD protocol over GPIO Bit Banging. Sneaky tricks to align stray bits into proper bytes
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |