cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime DFU application in STM32L4 series

Lakshmi Lavanya
Associate II
Posted on December 08, 2016 at 14:07

Hello Everyone,

I need DFU application which can load the new firmware at run time.

I want to implement DFU in stm32l476G-Eval board, tried with DFU bootloader method (Connecting Boot0 to VCC) it is working fine.

Compiled the DFU standalone example application and ran it but it is not showing as a DFU device when i connected the eval board to PC.

Can any body explain or point me to the links which can explain how to implement the DFU standalone method. How the run time DFU will work? how much space it will take for the DFU code?

#stm32l4 #usb #stm32l476g-eval #stm32l4-dfu-runtime #dfu

Note: this post was migrated and contained many threaded conversations, some content may be missing.
37 REPLIES 37
Imen.D
ST Employee
Posted on December 08, 2016 at 14:59

Dear

gamini.lakshmi_lavan

,

Welcome to theSTM32 forum.

I recommend that you have a look to the application note

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD001675pdf/files/CD001675pdf/jcr:content/translations/en.CD001675pdf

'STM32 microcontroller system memory boot mode', find information and requirements related to the STM32L476xx device with DFU bootloader.

For using DFU on STM32, I recommend you to review the following resources:

-

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-stm32html

' Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension'.

-

http://www.st.com/content/ccc/resource/technical/document/application_note/6a/17/92/02/58/98/45/0c/CD00264pdf/files/CD00264pdf/jcr:content/translations/en.CD00264pdf

'USB DFU protocol used in the STM32 bootloader'

-

https://st-videos.s3.amazonaws.com/BOOTLOADER.mp4

Getting started with STM32 built-in USB DFU Bootloader

Hope this helps you.

Best Regards

-Imen-

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on December 08, 2016 at 17:17

Look at how large the version you built now. Look at how large the ROM is.

I've generally avoided writing a DFU stand-alone by jumping into the ROM (F2/F4) and using that instead.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 09, 2016 at 05:19

Hi Imen,

Thanks for your reply.

I am able to load the new firmware using Bootloader DFU mode, but i need run time DFU mode.

I have to enable the DFU class and USB device code, after that what i need to add in my code to get my device as a DFU capability device.

Here when i connected it to PC it is not detecting as a USB DFU device.

Posted on December 09, 2016 at 05:28

Hi Clive,

Thanks for your reply,

Here i need Run time DFU application for my end product.

So how can i achieve this without Bootloader mode and jumping into the ROM means? 

In the standalone example they said that DFU code is in Flash memory (Starting location).

Can you please explain me how the stand alone DFU works.

Posted on December 09, 2016 at 05:31

In my final product the BOOT0 pin is connected to Ground. So i can't change the Bootloader. Can you please point me, how to achieve my device as a DFU device and i have to load the new firmware using my DFU device. 

Posted on December 09, 2016 at 14:10

I'm not sure I'd design with BOOT0 physically tied to ground, it tends to foreclose options in manufacturing and test, and failure analysis of returns, but no matter.

The ROM is still mapped into memory, and you can still transfer control to it. On most current STM32 parts

SYSCFG_MEMRMP

controls the mapping of the ROM into the zero space, the equivalent of the BOOTx pins. The control transfer has been discussed here before, the specific address of the L4 ROM is something I don't know off the top of my head, but if you map the ROM in the zero space first, you can then jump via the vectors at +0 and +4. A quick search should turn up several examples and threads.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 12, 2016 at 06:38

Hi Clive,

Is it possible to implement the DFU device with out using Bootloader options? means if i enable DFU class in my application, how to handle it properly run time.

If i want to use Boot loader option, How can the device knows when it wants to jump from Application area to System memory. Can you provide any example or links to understand the Run time DFU use case.

Posted on December 12, 2016 at 08:00

I'm sure it is possible, not something I'm looking to work on.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Lakshmi Lavanya
Associate II
Posted on December 12, 2016 at 10:26

To get the DFU mode at run time, do i need two applications (one for DFU and one for actual application)?

In single application, how can i achieve the DFU mode?

Is any one did this before, if so can you please explain about run time DFU.