2021-12-01 06:37 PM
Hi,
I have been trying to make a custom bootloader for STM32F413.
I use STM32CubeProgrammer, USB DFU
Although I have succeeded to make a custom bootloader for another MCU (STM32F412), it's first time that STM32CubeProgrammer erase an unexpected address.
I just wanted to use 0x0804 0000 as start address of application.
But, STM32CubeProgrammer implemented like the log below
10:01:21:342 : Opening and parsing file:
10:01:21:345 : File :
10:01:21:345 : Size : 654340 Bytes
10:01:21:345 : Address : 0x08040000
10:01:21:345 : Erasing Segment <0> Address <0x08040000> Size <654340>Bytes
10:01:21:345 : Erasing memory corresponding to segment 0:
10:01:21:346 : DFU status = 0
10:01:21:346 : DFU State = 5
10:01:21:346 : Status: 0, State: 5
10:01:21:346 : sending a page erase request @: 0x08024000
10:01:21:357 : DFU status = 0
10:01:21:358 : DFU State = 4
10:01:21:404 : DFU status = 0
10:01:21:405 : DFU State = 5
10:01:21:405 : erasing sector 0006 @: 0x08024000 done
10:01:21:405 : DFU status = 0
10:01:21:405 : DFU State = 5
10:01:21:405 : Status: 0, State: 5
10:01:21:405 : sending a page erase request @: 0x08044000
10:01:22:289 : DFU status = 0
10:01:22:289 : DFU State = 4
10:01:22:338 : DFU status = 0
10:01:22:339 : DFU State = 5
10:01:22:340 : erasing sector 0007 @: 0x08044000 done
Why did programmer erase 0x0802 4000?
When I changed address to 0x0806 0000, programmer wanted to erase 0x0804 4000.
I don't know what i missed and what can I do.
Thanks in advance for any help.
Solved! Go to Solution.
2021-12-16 10:14 PM
Resolved...
I suspected STM32CubeProgrammer. But I realize it was just my fault, as always.
As above, CubeProgrammer use a USBD_DFU_MEDIA interface for memory mapping.
Previous : @Internal Flash /0x08000000/04*016Ka, 01*016Ka, 01*064Kg,10*128Kg
Current : @Internal Flash /0x08000000/04*016Ka, 01*064Kg,11*128Kg
2021-12-02 10:37 AM
Erase can start only on a sector boundary. STM32F4 has sectors of different sizes. Please check that your desired address is on a sector boundary.
2021-12-02 05:06 PM
Hi, Pavel A.
You are right. but I have already checked it.
I referred to the RM0430 Reference manual because i used a STM32F413ZGTx.
I even checked it using CubeProgrammer and ST-Link.
So I have been thinking that STM32CubeProgrammer is confused when using USB not ST-link.
I want to know why...
2021-12-16 10:14 PM
Resolved...
I suspected STM32CubeProgrammer. But I realize it was just my fault, as always.
As above, CubeProgrammer use a USBD_DFU_MEDIA interface for memory mapping.
Previous : @Internal Flash /0x08000000/04*016Ka, 01*016Ka, 01*064Kg,10*128Kg
Current : @Internal Flash /0x08000000/04*016Ka, 01*064Kg,11*128Kg