0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

reTerminalのファームウェアアップデートをBookwormで行う

Posted at

こちらのオフィシャルにあるやり方だとBookwormではファームウェアのアップデートができない。
https://lab.seeed.co.jp/entry/2021/11/25/120000

本来ならBookwormを入れる前にファームウェアアップデートを行ってからBookwormをインストールすればいいと思うのだが、すでにBookwormを入れてしまってからファームウェアが古いことに気付いた場合は、bcm2835gpioを使ってやれば解決する。

基本的なやり方は上記のオフィシャルの通りに進めるんだけど、下記でエラーが出る。

$ ./xpack-openocd-0.11.0-2/bin/openocd -f interface/sysfsgpio-raspberrypi.cfg -c "transport select swd" -f target/stm32g0x.cfg -c "program STM32G030F6_R2.bin verify 0x08000000;shutdown"
xPack OpenOCD aarch64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
SysfsGPIO nums: swclk = 11, swdio = 25

swd
Info : SysfsGPIO JTAG/SWD bitbang driver
Error: Couldn't export gpio 11
Error: sysfsgpio: Invalid argument
Error: Couldn't unexport gpio 11
Error: Couldn't unexport gpio 25
Error: No Valid JTAG Interface Configured.

こうしたらできた。

cat > cm4-bcm2835.cfg << EOF
adapter driver bcm2835gpio
bcm2835gpio_peripheral_base 0xfe000000
bcm2835gpio_speed_coeffs 236181 60
adapter gpio swclk 11 -chip 0
adapter gpio swdio 25 -chip 0
transport select swd
adapter speed 1000
EOF

sudo openocd -f cm4-bcm2835.cfg -f target/stm32g0x.cfg -c "program STM32G030F6_R2.bin verify 0x08000000;shutdown"

こういう感じになればOK。

$ sudo openocd -f cm4-bcm2835.cfg -f target/stm32g0x.cfg -c "program STM32G030F6_R2.bin verify 0x08000000;shutdown"
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'bcm2835gpio peripheral_base' not 'bcm2835gpio_peripheral_base'
DEPRECATED! use 'bcm2835gpio speed_coeffs' not 'bcm2835gpio_speed_coeffs'
adapter speed: 1000 kHz

Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 2001 kHz
Info : SWD DPIDR 0x0bc11477
Info : [stm32g0x.cpu] Cortex-M0+ r0p1 processor detected
Info : [stm32g0x.cpu] target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32g0x.cpu on 3333
Info : Listening on port 3333 for gdb connections
[stm32g0x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x08000a48 msp: 0x20002000
 Programming Started 
Info : device idcode = 0x10016466 (STM32G03x/G04xx - Rev Z : 0x1001)
Info : RDP level 0 (0xAA)
Info : flash size = 32 KiB
Info : flash mode : single-bank
Info : Padding image section 0 at 0x08004324 with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x08004328 .. 0x080047ff
 Programming Finished 
 Verify Started 
 Verified OK 
shutdown command invoked
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?