Skip to main content
Visitor II
January 19, 2025
Solved

Problem with built-in bootloader over CAN with STM32F466

  • January 19, 2025
  • 3 replies
  • 1677 views

Hi, i can definitely use a push in the right direction as i am really stuck on this one.

Goal is to push new firmware onto a STM32F446 via the built-in bootloader. For this i have connected two MCU's on a CAN bus, the receiving one is a STM32F446. I use CAN2 (see an2606 table 80) pin PB5 as RX and PB13 as TX.  Strange combination by the way. One if default and one is the alternate pin. Anyway..

Baudrate is set to 125kHz on both MCU's. I reset the STM32F446 with BOOT0 high so i get into the bootloader. 
On the sending side, i send out a can message with id 0x79 with one byte data, a 0x00. (documention states it does not matter what you send, so i thought to do one byte with just a zero)   

This should trigger a response from the bootloader with a ACK, but it does not. I get nothing. What i see is that the target reboots after this message. I suspect becuase of a timeout or other error or so. It happens fast, so timeout is probably in a few ms or so.

I have tried different id's (0x7E0 for example) and different payloads (0x02, 0xfd) to trigger a get-chip-id. No joy.

Any idea's? 

    This topic has been closed for replies.
    Best answer by Oleksii

    Знімок екрана з 2025-01-20 21-55-52.png

    3 replies

    Graduate II
    January 20, 2025

    You checked the connection diagram, connected the transceivers, resistors 120 om, etc. 

    Problems usually arise at this stage.)

    bonzoAuthor
    Visitor II
    January 20, 2025

    Hi i have checked the connection and the canbus works fine. Both ends have a 120 ohm resistor, and i can succes transmit data over the bus.

    Somehow this post has switched to 'solved' but this has not been solved. How can i remove the 'solved' ?

    Kind regards

    bonzoAuthor
    Visitor II
    January 20, 2025

    Can some admin please reset the 'solved' from this post?  The problem was not solved and i don't know why it switch to solved.

    bonzoAuthor
    Visitor II
    January 20, 2025

    Hi, i don't have an oscillator on the F446 at the moment. I have seen the document but i had the impression it would still run without external oscillator.. 

    Are you suggesting i need an external oscillator for the bootloader to work over CAN ?

    Thats not easy to test for me at the moment as it requires a new pcb, but if that's the issue then the way forward is clear.  

    Graduate II
    January 20, 2025

    CSTNE8M00G55Z000R0

    8 MHz Ceramic Resonator Built in Capacitor 33 pF ±0.2% 40 Ohms -40°C ~ 125°C 

    Already contains compensation capacitors

     
    OleksiiAnswer
    Graduate II
    January 20, 2025

    Знімок екрана з 2025-01-20 21-55-52.png

    bonzoAuthor
    Visitor II
    January 20, 2025

    Solid point. I did not look at that enough i guess. Thanks!

    I will order a new pcb tomorrow morning with an external oscillator on it. Will take a week or so before i can commence my testing. 

    Just thinking out loud; while waiting for the new board. Could i configure the CAN periferal in normal code, and then jump to an address inside the bootloader just after where it initialises and configures the CAN interface. In theory, i should be able to test the protocol, right?  Just have no idea where to jump to actually.. probably not a documented address.

    Cheers, to be continued...

     

    PS by the way, i there some documentation of how the can pins should be wired in a typical situation? Reason why  i ask is because PB5/PB13 is not a normal CAN pin combination. PB5 is part of an alternate config, while PB13 is part of the standard config.