cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CAN Bootloader Problem! How to Verify !!

berwechy
Associate II
Posted on August 07, 2015 at 10:34

Hello All,

I'm trying to implement a CAN bootloader to communicate over the CAN bus network.

I'm using the own developed STM32F107VCT6 board with fine CAN2-remap.

And the application would run successfully via CAN2-remap.

I could success enter the bootloader via USART1 and could make sure the BOOT0 & BOOT1 and bootloader is correct.

When I try to send the CAN bootloader commands to init the communication as described in STM Application Note AN3154 the board doesn't respond at all.

My CAN network is setup correctly at 125 kbps and standard CAN messages. I made sure that the CAN communication works by checking the tranmission on a separate CAN bus monitor.

After the 107VCT6 board power-on, I send the std CAN frame with ID=0x79 and DLC is 0 for 3 times. and then send the CAN frame with ID=0x00/DLC=0 to get something. Nothing reponse.

I have no idea why the bootloader doesn't respond to my CAN commands. Is there anything else I need to do on the STM32 side other than setting the boot pins as described above? I also tried using the UART bootloader on UART3 which works properly.... only the CAN side is giving me issues.

How do I verify the CAN protocol of bootloader?

#can-bootloader-stm32-stm32f107
4 REPLIES 4
stm32forum
Associate II
Posted on August 07, 2015 at 11:52

What pins are you using?

According http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf the pins are remapped and you need to use are PB5 Can_rx & PB6 Can_tx.

berwechy
Associate II
Posted on August 07, 2015 at 17:25

Yes, I already have choosen CAN2-Remap pins.

It seems not work.

Should I pull-up unused pins like USART/USB ?

I make sure that the bootloader already has run because the official FLASHDEMO could be connected via RS232.

And I use USB-TO-CAN dondle to connect CAN interface and snnifer packet from logical analysis tool, The CAN frame with StdId:0x79 is sent.

Sniffer no response from logical analysis.

How do I verify my CAN bootloader sequence is correct ?  

Posted on August 07, 2015 at 17:49

You could double check the version of the System Loader.

It's important to only have transitions on the SINGLE interface you want to use. Errant signals on USART1 PA9/PA10 will be auto-bauded, and that interface will be selected.

There are very specific external crystal values that are supported for CAN operation. F107 -> 8 MHz, 14.7456 MHz or 25 MHz. CAN2 on PB5/PB6

You can't use a transceiver that requires enabling by another GPIO pin, which the System Loader isn't going to configure/control.

http://www.st.com/web/en/resource/technical/document/application_note/CD00264321.pdf

http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
berwechy
Associate II
Posted on August 10, 2015 at 10:03

Thanks for clive1.

I check the OSC and discover that my external clock is 24Mhz and not 8Mhz.

After I change the OSC to 8Mhz, the bootloader already has communicated to my USB-TO-CAN dongle and could response with commands according to CAN protocol.

Thanks your hint.