2017-04-10 03:28 AM
Good mornign,
I'm working in my application that is based on STM32L475 device.
I'm able to flash my device by using the Dfulse Demo software and setting Boot0 to 1 when applying power to device. But I would like to implement and manage DFU functionality in run time via USB: the aim is to have dual bank functionality in order to update firmware without having to change Boot0 pin.
What I have first done is to set DFU parameters using STM32CubeMX:
- USB_OTG_FS peripheral as device_only
- Middlewares --> USB_DEVICE: Class For FS IP = Download Firmware Update Class (DFU)
Then I have flashed my device with this setup (project created from Cube) and I thought the device should be recognized when connecting it to PC via USB. But, it was not.
So, which are the best steps to follow to implement this functionality? Is there any example that matches this behaviour?
Best regards.
#usb #dfu #stm32l42017-04-10 06:16 AM
Hi Daniel,
You can take the DFU example available under following directories in the STM32CubeL4 package (just comment BSP related code if you aren't using
STM32L476G-Discovery orSTM32L476G_EVAL
:(Please pay attention to replaceHSICalibrationValue by MSICalibrationValuein SystemClock_Config function (main.c) in order to avoid issue described in
https://community.st.com/0D50X00009XkeotSAB
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2017-04-10 09:16 AM
Thank you Amel,
I have tried the first example you have written and it works with my proto.
But the question is: why it is not working with STM32CubeMx?
Dani.
2017-04-10 09:23 AM
May be you need to increase heap and stack size in CubeMX before generating project.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2017-04-10 09:31 AM
If I need to change these parameters, I guess there is any type of bug with Cube, right?
And how do I know the right values for heap and stack size?
On the other hand, when I proceed in the same way with the STM32F3 with Cube, it works already the first time... This is the way it should be for any device....