cancel
Showing results for 
Search instead for 
Did you mean: 

Is the stm system bootloader (trough CANBUS) just not woking when more than one device shares the bus?

Javier1
Principal

Hi, i find myself wanting to use stm bootloader instead of having to code my own.��

My setup consists in 4 identical nodes hooked up to a 2m long canbus.0693W000007Z6fwQAC.png

  • I can boot and talk with the canbus bootloader only when a single node is powered on in the bus.(the device enters its bootloader mode and waits for the 0x79 canbus command)0693W000007Z6kIQAS.png

  • Noone else in the bus is TXing anything only listening,

  • BUT ....when more than one node is powered on ... the single node i want to boot doesnt reply to the 0x79 command (and i know is listening because as soon as i power off the rest of nodes and i send 0x79 trough canbus i get a reply from its bootloader)

  • Extra weird thing this only happens with the initial 0x79 command, if i power on the rest of the nodes AFTER this 0x79 negotiation is done i am able to continue talking with the bootloader.

I found this note in the AN3154 appnote

0693W000007Z6nCQAS.pngI dont use more than one node at a time....

we dont need to firmware by ourselves, lets talk
1 ACCEPTED SOLUTION

Accepted Solutions
Javier1
Principal

from ST support:

Description: Hello, unfortunately the CAN bootloader is designed for use cases where other CAN nodes are not active, which is not suitable for some application. I'm afraid the customer would have to write their own bootloader, or some how temporarily disable the other nodes on the bus. We don't have example for CAN bootloader, but we do for UART: https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-iap-usart.html

So it might be useful for customer as reference.

Best regards, @Adam BERLINGER​ 

we dont need to firmware by ourselves, lets talk

View solution in original post

5 REPLIES 5

>>i find myself wanting to use stm bootloader instead of having to code my own.

At that point you have little control of the situation, best not to be beholden to the design choices of others..

Can you clamp the unused nodes in reset whilst using the ST system loader? Or gate the transceiver with the BOOT0 or NRST pins?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

>>At that point you have little control of the situation, best not to be beholden to the design choices of others..

I find the stm bootloader very well documented and already factory flashed (it doesnt eat up memory and works out of the box) so its just convenient for me.

Or so i tought.... i believe there is some canbus ACKing and NACKing silly logic behind my bug.

>>Can you clamp the unused nodes in reset whilst using the ST system loader? Or gate the transceiver with the BOOT0 or NRST pins?

My backup plan was disabling every other canbus for 30 seconds and enabling them again (hardware) but i want to fight this trough a bit more.

we dont need to firmware by ourselves, lets talk

0693W000007Z7eGQAS.pngI just found another person with my same bug two years ago.

And while sniffing the bus i think i figured it out, for some silly reason the bootloader is expecting the first 0x79 command to be NACKED and only after that reply to the next 0x79 command.

If you send the 0x79 only once (automatic resend disable) the bootloader doesnt work either

we dont need to firmware by ourselves, lets talk
Javier1
Principal

from ST support:

Description: Hello, unfortunately the CAN bootloader is designed for use cases where other CAN nodes are not active, which is not suitable for some application. I'm afraid the customer would have to write their own bootloader, or some how temporarily disable the other nodes on the bus. We don't have example for CAN bootloader, but we do for UART: https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-iap-usart.html

So it might be useful for customer as reference.

Best regards, @Adam BERLINGER​ 

we dont need to firmware by ourselves, lets talk
Sirk77
Associate II

Dear ST Support,

Anything changed since 2021 and canbus bootloader?

I have few STM32L4 on bus and I got the same issue.

Do you have any example of can bootloader which can supports more can device?