2015-07-27 06:27 PM
Hi,
I have some code for entering DFU mode from my application which works on the STM32F4: https://github.com/micropython/micropython/blob/master/stmhal/modpyb.c#L70-L87 I'd like to do something equivalent on the STM32F7 (I have an STM32F7 Discovery board which has the STM32F746 MCU) There doesn't seem to be any __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH macro defined in the STMCubef7 files. I'm able to successfully enter DFU mode by wiring in a switch between VCC and R42 (the BOOT0 line). I'd really like to be able to enter DFU mode without having to flip any switches.2015-07-27 08:04 PM
It doesn't have the same sort of mapping.
The following would probably suffice:// arm-none-eabi-gcc 4.9.0 does not correctly inline this
// MSP function, so we write it out explicitly here.
//__set_MSP(*((uint32_t*) 0x1FF00000));
__ASM volatile (''movs r3, #0x1FF00000
ldr r3, [r3, #0]
MSR msp, r3
'' : : : ''r3'', ''sp'');
((void (*)(void)) *((uint32_t*) 0x1FF00004))();
2015-07-29 10:44 AM
Thanks.
I had to change it slightly. This seems to work:// arm-none-eabi-gcc 4.9.0 does not correctly inline this
// MSP function, so we write it out explicitly here.
//__set_MSP(*((uint32_t*) 0x1FF00000));
__ASM
volatile
(
''movw r3, #0x0000
movt r3, #0x1FF0
ldr r3, [r3, #0]
MSR msp, r3
''
: : :
''r3''
,
''sp''
);
((
void
(*)(
void
)) *((uint32_t*) 0x1FF00004))();