2017-05-16 03:47 AM
I am using DFU source code for nucleo board available in STM32F2Cube.I have generated .dfu file from existing GPIO code. but when i am upgrading the dfu file into nucleo board it is showing as upgrade successful and after clicking on leave DFU mode it is indicating successfully left DFU mode but it is again coming back to DFU mode.
I am using
-SW4STM32 for generating binary/hex
-DfuSeDemo v3.0.5
-while converting from bin to dfu i am giving address as 0x08008000
Note: this post was migrated and contained many threaded conversations, some content may be missing.Solved! Go to Solution.
2017-05-16 07:22 AM
Try to update this code on the main.c of the DFU application as below:
/* Test if user code is programmed starting from address 0x0800C000 */
if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000)
to this line:
/* Test if user code is programmed starting from address 0x0800C000 */
if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFC0000 ) == 0x20000000)
Please, keep me informed then about your updates.
Imen
2017-05-16 04:21 AM
Hi
Dhuri.Pranay
,WhichPlatform used (board, device, how USB is connected on the board) ?
Check the sector count !
It maybe causes the problem or probablyyou have issue on the file you are using.So, please make sure to use a correct .dfu file, to perform download and verify before Leave DFU mode.
If you are using
STM32F207ZG-Nucleo, y
ou can find a reference .dfu file on the last version of Cube firmware STM32CubeF2 v1.4.0:STM32Cube_FW_F2_V1.4.0\Projects\STM32F207ZG-Nucleo\Applications\USB_Device\DFU_Standalone\Binary
I hope this helps you.
Regards
Imen
2017-05-16 06:57 AM
Hi....dfu file which is provided in STM32cubeF2 is working for me but my generated dfu files giving problem...i have attached dfu file.
2017-05-16 07:22 AM
Try to update this code on the main.c of the DFU application as below:
/* Test if user code is programmed starting from address 0x0800C000 */
if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000)
to this line:
/* Test if user code is programmed starting from address 0x0800C000 */
if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFC0000 ) == 0x20000000)
Please, keep me informed then about your updates.
Imen
2017-05-16 07:37 AM
Hi Imen,
I have updated the code to the code that you have mentioned, now it is able to leave the DFU mode but upgraded code is not running...binary file which i am converting to dfu is working alone ,no issues with .bin
2017-05-16 07:44 AM
Hi
Dhuri.Pranay
,Be sure you are updating the
USBD_DFU_APP_DEFAULT_ADD
in theusbd_conf.h2017-05-16 08:01 AM
Yes, I have updated USBD_DFU_APP_DEFAULT_ADD as well as updated FLASH origin to 0x0800C000 in linker script (.ld file) and also set address as 0x0800C000 while bin to dfu conversion but still not running gpio code.
2017-05-16 08:11 AM
Please set the vector Table to
0xC00 instead of 0x00 i
n the system_stm32f2xx.c file of your project&sharpdefine VECT_TAB_OFFSET 0x00
Edit: Sorry, I means
vector Table should be
0xC000
2017-05-16 08:45 AM
After setting vector table to 0xC00 and Flash base address to 0x0800C000 (SCB->VTOR = 0x0800C000 | VECT_TAB_OFFSET;)
upgraded code is running but while verifying in DfuseDemo it is indicating
matching not good. first difference at address 0x0800C004
File byte is 0x
Read byte is 0x9D