cancel
Showing results for 
Search instead for 
Did you mean: 

ST OpenBootloader and STM32CubeProgrammer CANBUS sends invalid command

jondobrinc
Associate

Hello, I've been trying to port over ST OpenBootloader for use with an STM32L431KBUx over CAN. I specifically want to use CAN pins PA11 and PA10 as those are what are available in the package I chose.

 

As I am porting over the ST Openbootloader code found here: https://github.com/STMicroelectronics/stm32-mw-openbl

 

I noticed a few strange things:

1. there is no can_interface file set so I had to write my own

2. the project calls for app_openbootloader file set but those do not exist in the project so I grabbed it from an example project.

 

I am also following this application note: https://www.st.com/resource/en/application_note/cd00264321-can-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

 

Anyway, I got past these issues no problem.

 

The issue I am running into now is when I try to connect my STLink V3SET to the STM32L431 over CAN using STM32CUBEProgrammer. When I hit connect, the program sends over CAN STD ID 0x79 with no data. My code will send back the STD ID (0x79) with a NACK(0x1F) indicating that the command doesn't exist. STM32CubeProgrammer then gives me a BRG_BL_NACK_ERR and I am unable to continue.

 

After looking at the documentation, code, and example code, I am unable to find the opcode/command 0x79 anywhere. So, I am confused as to why STM32CUBEProgrammer sends that command. I see that 0x79 is supposed to be an ACK but that is it. It shouldn't be sent as the STD ID/command/opcode. Please let me know what I am missing here.

CAN TX LINE: 

jondobrinc_0-1722962360967.png

 

 

 

I am using a PEAK PCAN to sniff the bus. I am using C_TX(pin 9) and C_RX(pin 8 ) on the stlink v3set to connect to a CAN transceiver (https://www.adafruit.com/product/5708)

 

UPDATE: I have solved it by sending an ACK when receiving CAN STD ID 0x79

1 ACCEPTED SOLUTION

Accepted Solutions
jondobrinc
Associate

I have solved it by sending an ACK when receiving CAN STD ID 0x79

View solution in original post

1 REPLY 1
jondobrinc
Associate

I have solved it by sending an ACK when receiving CAN STD ID 0x79