2021-06-09 02:35 AM
Hello,
I'm trying to update a micro over DFU (USB) mode since we don't always have access to the STlink programmer.
I managed to start the unit in System Memory mode by reading a backup register at startup and jumping to system firmware if it's a certain value:
/* Jump into bootloader if backup register 1
* has 0xB007104D written
*/
if(0xB007104D == RTC->BKP1R)
{
RTC->BKP1R = 0x0;
uint32_t JumpAddress = *(__IO uint32_t*)(SYSMEM_ADDRESS + 4);
pFunction Jump = (pFunction)JumpAddress;
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
__set_MSP(*(__IO uint32_t*)(uint32_t)SYSMEM_ADDRESS);
Jump();
while(1);
}
To be honest, I've seen similar flavours of the same code for this purpose.
The thing is, the unit restarts in DFU mode, at least the PC says so:
But DfuSeDemo won't give me the option to use it:
However, it seems that STM32Programmer works:
Questions:
Any hints are greatly appreciated.
Cheers,
Alberto
Solved! Go to Solution.
2021-06-09 05:12 PM
Hi all,
I just noticed that this has been solved elsewhere:
Thanks!
Cheers,
Alberto
2021-06-09 05:12 PM
Hi all,
I just noticed that this has been solved elsewhere:
Thanks!
Cheers,
Alberto