cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent help: How to use CAN bus interface to perform stm32f042k6 DFU?

MAlam
Associate

MCU - STM32f042k6

Stage - Feasibility study to make a proof of concept in 10 working days.

My team is using CAN bus interface of stm32f042k6 in a project. As a requirement, we need to see the possibilities of DFU over CAN bus interface of stm32f042k6. Flash memory is 32KBytes and the current single firmware image is occupying about 12KB memory with 500 bytes of SRAM. Checking AN2606 and AN3154, however, I could not find any sample bootloader code that can help us to understand how does in work in STM32 over CAN. Will it be possible to fit a bootloader + 2 memory banks (+image headers) for 2 firmware images (do not consider secure booting or any other complexity at this moment) in this MCU?

Can you please share some guideline and a sample project if possible?

2 REPLIES 2

The ST-LINK/V3SET supports CAN via STM32 Cube Programmer for parts that have a CAN loader in System ROM.

ST generally assumes people building CAN products have CAN experience/competency, or can hire/contract it, work with your local ST FAE, presuming your business volume supports such.

Yes, I think fitting the firmware update code, and staging will be difficult. Typically one might consider a low cost SPI/QuadSPI type NOR Flash so the entire image can be held and validated, as this allows for much simpler code on the loader side stub to update the app in the STM32's internal flash, which is ill-suited to real-time update and interfacing as it stalls the processor significantly unless all functionality can be constrained into RAM. Staging also allows for retry, recovery, and encryption.

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

Hi @Community member​ 

Thank you for sharing your opinion and insightful information. Our recent findings are aligned with your comment. We have already dropped secure booting algorithms to reduce the FW image and fit in to the memory however it is still not enough. QSPI is a good alternative and we will only concentrate on this IFF it is allowed (impact on BOM, QA plan). In touch with local FAE, hoping to get a reply soon.