2019-08-03 19:38:59 -07:00
|
|
|
/*
|
|
|
|
* dfu_init.h
|
|
|
|
*
|
|
|
|
* @date Aug 3, 2019
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2019-08-03 19:38:59 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_LAYER_PORTS_STM32_STM32F7_DFU_INIT_H_
|
|
|
|
#define HW_LAYER_PORTS_STM32_STM32F7_DFU_INIT_H_
|
|
|
|
|
2021-04-03 18:58:29 -07:00
|
|
|
// System control block registers base
|
2019-08-03 19:38:59 -07:00
|
|
|
LDR R1, =0xE000ED00
|
2021-04-03 18:58:29 -07:00
|
|
|
|
|
|
|
// location of system memory (DFU bootloader)
|
2019-08-03 19:38:59 -07:00
|
|
|
LDR R0, =0x1FF00000
|
2021-04-03 18:58:29 -07:00
|
|
|
|
|
|
|
// Set the vector table offset to the sysmem image
|
2019-08-03 19:38:59 -07:00
|
|
|
STR R0, [R1, #8]
|
2021-04-03 18:58:29 -07:00
|
|
|
|
|
|
|
// load the stack pointer
|
2019-08-03 19:38:59 -07:00
|
|
|
LDR SP, [R0, #0]
|
2021-04-03 18:58:29 -07:00
|
|
|
|
|
|
|
// prepare for jump to bootloader
|
2019-08-03 19:38:59 -07:00
|
|
|
LDR R0, [R0, #4]
|
|
|
|
|
|
|
|
#endif /* HW_LAYER_PORTS_STM32_STM32F7_DFU_INIT_H_ */
|