Firmware Update

The board has two STM32F407 MCUs, each with a separate SWD programming connector. To update the complete board, program both MCUs. The same image can be used on both when they perform the same function.

Important: Do not perform a full-chip erase. A full erase removes factory identification, saved communication settings, and offline batches. A normal update only requires programming and verification.

Choose the Firmware File

File

Purpose

spine_v4_v47_release.bin

Complete SANPO V47 factory firmware for production programming and normal updates

spine_v4_v47_customer_sdk.bin

Default build from the SANPO firmware development framework; use only when working with that framework

If the release package contains a newer version number, use firmware and documentation with matching versions. Do not program V4 firmware onto an STM32G473-based V6 board.

Preparation

  • Download and install STM32CubeProgrammer.

  • Prepare an ST-LINK and SWD cable.

  • Power the control section through USB or the board 5 V input.

  • Stop the motor and disconnect high-voltage motor power before updating.

  • Record communication settings and offline batches in case they need to be restored.

See Board Schematic and Pinout for SWDIO, SWCLK, and GND.

Update the Factory Firmware with STM32CubeProgrammer

  1. Connect ST-LINK to the first STM32 SWD connector and power the control section.

  2. Open STM32CubeProgrammer, select ST-LINK and SWD, and connect.

  3. Open spine_v4_v47_release.bin.

  4. Set the BIN start address to 0x08000000.

  5. Enable verification after programming, program the device, and confirm verification succeeds.

  6. Disconnect in the software and move ST-LINK to the second STM32 SWD connector.

  7. Repeat the programming and verification with the same file and address.

  8. Disconnect ST-LINK and power-cycle the board after both MCUs are complete.

Do not select Full chip erase, Mass erase, or an equivalent option. STM32CubeProgrammer automatically erases the sectors occupied by the image.

The V47 factory image and default development example are smaller than 128 KiB and do not enter the Flash sector used for saved communication settings. If a custom BIN reaches or exceeds 128 KiB, record the settings before programming. Once the program enters the area starting at 0x08020000, sector erase operations on STM32F407 may also erase saved settings even without a full-chip erase.

Check the Board After Updating

The complete board normally exposes two USB serial ports. Open each port and send the following as text:

AT+VER

V47 should return:

V47

Then test at least one CAN and one RS485 interface that your application uses. For Linux SocketCAN, you can also run:

sudo modprobe gs_usb
ip link show type can

A complete board normally exposes four canX interfaces. Linux interface numbering does not necessarily follow board silkscreen order, so confirm the mapping before controlling a motor.

Troubleshooting

Symptom

Action

ST-LINK cannot connect

Check SWDIO, SWCLK, GND, power, and the selected SWD connector; retry at a lower SWD clock

Programming succeeds but verification fails

Reconnect and program again; do not perform a full-chip erase first

Only one USB serial port appears

Confirm both STM32 devices were programmed and check the other USB connector and power

AT+VER returns nothing

Make sure no other program owns the port, send text, and use CRLF

Factory firmware no longer works after a full erase

Factory identification was removed; contact SANPO support to perform factory initialization again

Default bitrate or offline batches were lost

Configure communication again and re-upload the batches; see Offline Batch Execution

Program a Development or Custom Firmware

When using Developing with the SANPO Firmware, program the BIN or ELF produced by that project. Use program and verify, and do not perform a full-chip erase.

The CAN standard-frame, CAN extended-frame, and RS485 projects in Developing Custom Firmware use the same MCU and pin assignment. The same build can be programmed on either STM32. MCU (1) maps to CAN-1/2 and RS485-1/2; MCU (2) maps to CAN-3/4 and RS485-3/4.

Keil projects normally produce .axf and .hex files. You can program directly from Keil with ST-LINK, or select the generated .hex file in STM32CubeProgrammer and run program and verify.