2016-12-08 05:07 AM
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.2016-12-12 10:31 PM
Can any body give suggestions on this?
How to get the DFU run time with DFU class enabled.
2017-07-14 03:04 AM
Hi ,
I'm also trying to implement Run Time DFU via USB in STM32F207ZG port but I can't able to get proper document for that,
Any suggestion ? Pls share your Ideas...
With Thanks & Regards
K.Manikandan
2017-07-14 10:36 AM
This is the mechanism I use on F2/F4 designs to boot into the System Loader's DFU mode
https://community.st.com/0D50X00009XkgH0SAJ
2017-07-15 02:03 AM
Thanks a lot for your suggestion ,
I can't able to open the above link which you already share.
2017-07-15 12:48 PM
Please edit your post and remove the DEADLINKs, they are from previous version of the forum, I've created new links below
https://community.st.com/0D50X00009XkhAzSAJ
https://community.st.com/0D50X00009Xka1fSAB
https://community.st.com/0D50X00009Xkh7wSAB
https://community.st.com/0D50X00009XkhgYSAR
https://community.st.com/0D50X00009XkbZhSAJ
https://community.st.com/0D50X00009XkYIbSAN
2017-07-16 11:56 PM
Thanks for your information it's very useful for me...
2017-07-18 02:07 AM
Hi
K.Manikandan
,Have you achieved runtime DFU on STM32F207ZG nucleo?
2017-07-18 04:00 AM
Hi ,
I just tested with /home/STM32CubeF2/STM32Cube_FW_F2_V1.4.0/Projects/STM32F207ZG-Nucleo/Applications/USB_Device/DFU_Standalone ,by using this code I can able to detect the DFU device and also possible to upload the .dfu file.
2017-07-20 12:24 AM
Hi,
=====================================================================================
When I'm using BOOT0 pin = 1 and BOOT1 pin = 0 then I got below output (For Making Boot0 pin as 1 , I put Jumper between BT0 and VDD ( CN 11 - pin 5 and 7)
For Making Boot1 pin as 0, I put Jumper between PB2(BOOT1) and GND (CN12- pin 20 and 22)
kmani@kmani:~$ dfu-util --list
dfu-util 0.8Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan SchmidtThis program is Free Software and has ABSOLUTELY NO WARRANTYPlease report bugs to
mailto:dfu-util@lists.gnumonks.org
Found DFU: [0483:df11] ver=2200, devnum=32, cfg=1, intf=0, alt=3, name='@Device Feature/0xFFFF0000/01*004 e', serial='377D38603335'
Found DFU: [0483:df11] ver=2200, devnum=32, cfg=1, intf=0, alt=2, name='@OTP Memory /0x1FFF7800/01*512 e,01*016 e', serial='377D38603335'Found DFU: [0483:df11] ver=2200, devnum=32, cfg=1, intf=0, alt=1, name='@Option Bytes /0x1FFFC000/01*016 e', serial='377D38603335'Found DFU: [0483:df11] ver=2200, devnum=32, cfg=1, intf=0, alt=0, name='@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg', serial='377D38603335'=================================
kmani@kmani:~$ dfu-util -a 0 -s 0x08000000:leave -D /home/kmani/ARM_Toolchain/workspaceARM/USB_CDC_VCP/Debug/USB_CDC_VCP.bin
dfu-util 0.8Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan SchmidtThis program is Free Software and has ABSOLUTELY NO WARRANTYPlease report bugs to
mailto:dfu-util@lists.gnumonks.org
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!Opening DFU capable USB device...ID 0483:df11Run-time device DFU version 011aClaiming USB DFU Interface...Setting Alternate Setting ♯ 0 ...Determining device status: state = dfuERROR, status = 10dfuERROR, clearing statusDetermining device status: state = dfuIDLE, status = 0dfuIDLE, continuingDFU mode device DFU version 011aDevice returned transfer size 2048DfuSe interface name: 'Internal Flash 'Downloading to address = 0x08000000, size = 17288Download [=========================] 100% 17288 bytesDownload done.File downloaded successfullyTransitioning to dfuMANIFEST stateDFU mode working good.
========================================================================================
But When I'm using ...
/* DFU Class Config */
♯ define USBD_DFU_MAX_ITF_NUM 1 ♯ define USBD_DFU_XFER_SIZE 1024 /* Max DFU Packet Size = 1024 bytes */ ♯ define USBD_DFU_APP_DEFAULT_ADD 0x08008000 /* The first 3 sectors (48 KB) are reserved for DFU code */ ♯ define USBD_DFU_MAX_NB_OF_SECTORS 12 /* Max number of sectors: 12 sectors in Bank1 */int main(void)
{ /* STM32F207xx HAL library initialization */ HAL_Init(); /* Configure the System clock to have a frequency of 120 MHz */ SystemClock_Config(); /* Configure User Button */ BSP_PB_Init(BUTTON_USER, BUTTON_MODE_GPIO); /* Check if the User Button is pressed */ if(BSP_PB_GetState(BUTTON_USER) == 0x00) { /* Test if user code is programmed starting from USBD_DFU_APP_DEFAULT_ADD address */ if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000) { /* Jump to user application */ JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD + 4); JumpToApplication = (pFunction) JumpAddress;/* Initialize user application's Stack Pointer */
__set_MSP((*(__IO uint32_t*) USBD_DFU_APP_DEFAULT_ADD )); JumpToApplication(); } }/* Otherwise enters DFU mode to allow user programming his application */
/* Init Device Library */ USBD_Init(&USBD_Device, &DFU_Desc, 0); /* Add Supported Class */ USBD_RegisterClass(&USBD_Device, USBD_DFU_CLASS); /* Add DFU Media interface */ USBD_DFU_RegisterMedia(&USBD_Device, &USBD_DFU_Flash_fops);/* Start Device Process */
USBD_Start(&USBD_Device); /* Run Application (Interrupt mode) */ while (1) { }}=========================================================
I got the below output when i'm using above bootloader program without BOOT0 and BOOT1 pin
kmani@kmani:~$ dfu-util --list
dfu-util 0.8Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan SchmidtThis program is Free Software and has ABSOLUTELY NO WARRANTYPlease report bugs tomailto:dfu-util@lists.gnumonks.org
Found DFU: [0483:df11] ver=0200, devnum=35, cfg=1, intf=0, alt=0, name='@Internal Flash /0x08000000/02*016Ka,02*016Kg,01*064Kg,07*128Kg,04*016Kg,01*064Kg,07*128Kg', serial='377D38603335'
==============================================================
kmani@kmani:~$ dfu-util -a 0 -s 0x08000000:leave -D /home/kmani/ARM_Toolchain/workspaceARM/USB_CDC_VCP/Debug/USB_CDC_VCP.bin
dfu-util 0.8Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan SchmidtThis program is Free Software and has ABSOLUTELY NO WARRANTYPlease report bugs to
mailto:dfu-util@lists.gnumonks.org
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!Opening DFU capable USB device...ID 0483:df11Run-time device DFU version 011aClaiming USB DFU Interface...Setting Alternate Setting ♯ 0 ...Determining device status: state = dfuIDLE, status = 0dfuIDLE, continuingDFU mode device DFU version 011aDevice returned transfer size 2048DfuSe interface name: 'Internal Flash 'Downloading to address = 0x08000000, size = 17288dfu-util: Last page at 0x08004387 is not writeable========================================================================================
Form both output i noted that the version is difference ie., ver =2200 and ver 0200 ,but i don't know what is the exact problem please guide me.
With Thanks & Regards
K.Manikandan
2017-07-20 01:37 AM
Hi,
Check out my self-made bootloader. It does not require to utilize the BOOT pins, it features firmware update from an SD card, and also provides possibility to jump and launch the built-in st-bootloader (tested and works in DFU mode).