cancel
Showing results for 
Search instead for 
Did you mean: 

STLinkV3 + Stm32CubeProgrammer = Bridge Error (CAN Bootload)

EZamo.1
Associate III

Getting a "Error: Bridge error (BRG_CAN_ERR)". Can't find any documentation about it.

The StmLinkV3 is able to program the Nucleo (Stm32H743) via SWD fine.

In the screenshot's log section, the first message shows that the StLink doesn't detect the target's vcc.. so I had to connect the SWD cable between them, which kind of defeats the whole purpose of the CAN bootloading.. however even after it detects the target vcc, it fails to connect due to the BRG CAN ERR. I've tried all the different baud rates with no luck.

I have the Nucleo in bootloader mode (BOOT0=3.3V), with the STLink can bus (CN9 Pins 8/9) directly to the Nucleo's Can lines (CN9.25/27), crossing RX/TX.. although I've tried both ways. Actually, I get the error message even without connecting the TTL can lines to the target.

I'm using Stm32Cube v2.4 with an StLinkV3 MB1440B (firmware V3J5M1B3).

0693W000000VycvQAC.png

9 REPLIES 9
Ons KOOLI
Senior III

Hi EZamo.1,

According to the STM32H742, STM32H743/753 and STM32H750 Value line advanced Arm®-based 32-bit MCUs Reference Manual:

The embedded bootloader code is located in system memory. It is programmed by ST during production. It is used to reprogram the Flash memory using one of the following serial interfaces:

• USART1 on PA9/PA10 and PB14/PB15 pins, USART2 on PA3/PA2 pins, and USART3 on PB10/PB11 pins.

• I2C1 on PB6/PB9 pins, I2C2 on PF0/PF1 pins, and I2C3 on PA8/PC9 pins.

• USB OTG FS in Device mode (DFU) on PA11/PA12 pins

• SPI1 on PA4/PA5/PA6/PA7 pins, SPI2 on PI0/PI1/PI2/PI3 pins, SPI3 on PC10/PC11/PC12/PA15 pins, and SPI4 on PE11/PE12/PE13/PE14 pins.

Iam afraid that you cannot do this with CAN protocol.

Best Regards,

Ons.

EZamo.1
Associate III

The Reference Manual doesn't list it, but it does refer the reader to AN2606.. and in that document, it shows CAN bus is a supported bootloader for the STM32H74xxx/75xxx

0693W000000Vyi0QAC.png

Also, the StLink reports that error with or without connecting it to the target device. Is that normal?

EZamo.1
Associate III

Testing with an STM32H745I-DISCO board, it can be placed in bootloader mode and programmed via UART.

Trying to bootload via CAN bus using an St-Link-V3 (MB1440B firmware V3J5M1B3) has problems.

The St-Link-V3 has the JP7 (CAN_ON) jumper installed, its CN5's CAN_TX and CAN_RX pins are connected to an external transceiver (SN65HVD230). The transceivers H/L bus is connected to the STM32H745I-DISCO's CN11 Pins 1&2. The ST-Link V3 "CAN_VCC" is tied to VCC with the GND common to the DISCO, TRANSCEIVER and ST-LINK.

Stm32CubeProgrammer (v2.4) shows it has an error connecting to the DISCO via CAN bus. The GUI also reports 0v for the Target VCC, presumably because the interface is not SWD? In any case, I tried connecting the ST-Link V3's "T-VCC" to CAN_VCC but it did not make a difference.

How can we use ST-Link V3 to bootload via CAN bus the STM32H745I-DISCO?

Hello,

I have the identical problem on STM32F105. Have tried with STLinkV3SET and STLinkV3MODs: both treat identically.

Could be a software error. No response from ST yet. I'm waiting.

Unless it's a silicon rev issue, it's hard to imagine that the rom's CAN bootloader in the chip doesn't work.. I'm guessing an issue with the ST-link. But can't find any documentation on the CAN bootloading protocol.. or the St-Linkv3 schematics/source/error messages ("CAN_BRG").. so who knows.

But as a test, I tried sending the chip: 0x79 id (no data bytes) at a 500khz bit rate, from a Peak-USB device (instead of from the stlink) but like St support.. no response.

I also tried checking the st-linkv3 can_tx/can_rx pins, without anything physically connected to them. Interestingly, I see some activity on BOTH. Although, maybe the can_rx is just coupling from the can_tx.

Keep in mind the standard baud rate is 125 kbaud. I believe the ST32CubeProgrammer is not really suitable for CAN. At the moment I can only read and delete the memory. The download immediately hangs at the first block. Will try to debug the communication using PEAK-CANAnalyzer to see what is going on. I'm grateful for any suggestion.

Sounds like you've been able to at least get the F105 CAN bootloader to respond!

I verified the H745's ID reported at address 0x1FF1E7FE is 0x90.. which suggests the CAN bootloader is supported.

Unfortunately, despite using the Peak-USB to send commands listed in the application note .. like ID=0, ID=1, ID=2, ID=0x79.. none of them elicit a response from the chip. The GUI goes from OK to BUSHEAVY.. presumably because it's retrying due to no acknowledge.

0693W000000X9shQAC.png

0693W000000X9smQAC.jpg

I *think* I have a F105 board that I'll try to find and test with. From what I can tell, the application notes are very similar between the H7 (AN5405) and F105.. (AN3154)... only that the H7 can support flexible-data. How did you verify the read/delete memory commands?

Try the following using PEAK-USB interface at 125 kBaud & PCAN Viewer:

1)     Rest MCU while Boot 0 is kept high

2)     Send nil to Dev-ID 0x79, DLC=0

3)     Send 0x02 to Dev-ID 0, DLC=1

You should get the results as shown in attached file ***.txt. Hope it helps.

Regards

HWies.1
Associate II

Have tested STLinkV3 with STM32F407-Discovery Board: same poor effect! CAN boot with XMC4500 was sucessful but MCU is too expensive. Perhaps Aurix might be of interest for you :) (see attachments).