This is an old revision of the document!
Table of Contents
NUCLEO-G491RE
This boards contains a STM32G491xC microcontroller with a top speed of 170 MHz.
My first board was programmed twice before LD1 flagged a USB communication failure whilst in operation and it no longer enumerates on the bus.
This board also did not work on a USB1.1 hub when it did work.
The target can be programmed via PA13 and PA14 with the STLINK/V3 held in reset with JP1 and power set to 5V charger to workaround a faulty STLINK interface.
A replacement board appears to work but unproven to be reliable as yet and openocd can have problems resetting the CPU.
Pinout
The Arduino headers are almost compatible, the main difference being that D14/D15 are not the same I/O as AD4/AD5 by default.
Arduino compatible headers PB8 D15 I2C SCL PB9 D14 I2C SDA AVDD NC GND IOREF LD2 PA5 D13 SPI1 SCK RESET PA6 D12 SPI1 MISO 3V3 PA7 D11 SPI1 MOSI 5V PB6 D10 CS GND PC7 D9 GND PA9 D8 VIN B1 PC13 PA8 D7 PB10 D6 AD0 PA0 PB4 D5 AD1 PA1 PB5 D4 AD2 PA4 PB3 D3 AD3 PB0 PA10 D2 AD4 PC1/PB9 PC4/PA2 D1 USART1 TX (PC4 AF7) AD5 PC0/PA15 PC5/PA3 D0 USART1 RX (PC5 AF7) PA2 USART2_TX AF7 LPUART_TX AF12 ST-LINK PA3 USART2_RX AF7 LPUART_RX AF12 ST-LINK Morpho CN10 35 PA2 TX CN10 37 PA3 RX CN7 13 PA13 SWDIO CN7 15 PA14 SWCLK
Programming
st-info --probe Failed to parse flash type or unrecognized flash type Found 1 stlink programmers version: V3J9 serial: 004A00263331511734333834 flash: 524288 (pagesize: 2048) sram: 114688 chipid: 0x479 dev-type: STM32G49x_G4Ax
openocd -f "interface/stlink.cfg" -c "transport select hla_swd" -f "target/stm32g4x.cfg" Open On-Chip Debugger 0.12.0-rc2+dev-00028-g9501b263e (2022-12-15-23:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html hla_swd Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : clock speed 2000 kHz Info : STLINK V3J9M3 (API v3) VID:PID 0483:374E Info : Target voltage: 3.321600 Info : [stm32g4x.cpu] Cortex-M4 r0p1 processor detected Info : [stm32g4x.cpu] target has 6 breakpoints, 4 watchpoints Info : starting gdb server for stm32g4x.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : accepting 'gdb' connection on tcp/3333 [stm32g4x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x81000000 pc: 0x0800263c msp: 0x20002228 Info : device idcode = 0x10016479 (STM32G49/G4Axx - Rev 'unknown' : 0x1001) Info : RDP level 0 (0xAA) Info : flash size = 512 KiB Info : flash mode : single-bank Info : device idcode = 0x10016479 (STM32G49/G4Axx - Rev 'unknown' : 0x1001) Info : RDP level 0 (0xAA) Info : OTP size is 1024 bytes, base address is 0x1fff7000
gdb-multiarch (gdb) set arch arm The target architecture is assumed to be arm (gdb) target extended-remote localhost:3333 Remote debugging using localhost:3333 warning: No executable has been specified and target does not support determining executable automatically. Try using the "file" command. 0x0800263c in ?? () (gdb) info reg r0 0x37f 895 r1 0x0 0 r2 0x0 0 r3 0x2000000c 536870924 r4 0x3e9 1001 r5 0x25641 153153 r6 0x0 0 r7 0x0 0 r8 0x0 0 r9 0x0 0 r10 0x0 0 r11 0x0 0 r12 0xc00 3072 sp 0x20002228 0x20002228 lr 0x80033bf 134230975 pc 0x800263c 0x800263c xPSR 0x81000000 -2130706432 fpscr 0x2000000 33554432 msp 0x20002228 0x20002228 psp 0x0 0x0 primask 0x0 0 basepri 0x0 0 faultmask 0x0 0 control 0x4 4