Is the stm system bootloader (trough CANBUS) just not woking when more than one device shares the bus?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 07:42 AM
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.
- 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)
- 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
I dont use more than one node at a time....
Solved! Go to Solution.
- Labels:
-
CAN
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-28 11:41 PM
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​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 08:47 AM
>>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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 09:06 AM
>>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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 09:12 AM
I 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-28 11:41 PM
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​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-27 01:47 AM
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?