mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-03 11:24:10 +01:00
OP-917 add Bootloader support for IRQStack to reside in CCSRAM
+review OPReview-456
This commit is contained in:
parent
1eef6a7f06
commit
e1fdc41d7f
@ -170,7 +170,11 @@ void jump_to_app() {
|
|||||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||||
|
|
||||||
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
||||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
// Look at cm3_vectors struct in startup. In a fw image the first uint32_t contains the address of the top of irqstack
|
||||||
|
uint32_t fwIrqStackBase = (*(__IO uint32_t*) bdinfo->fw_base) & 0xFFFE0000;
|
||||||
|
// Check for the two possible irqstack locations (sram or core coupled sram)
|
||||||
|
if ( fwIrqStackBase == 0x20000000 || fwIrqStackBase == 0x10000000) {
|
||||||
|
/* Jump to user application */
|
||||||
FLASH_Lock();
|
FLASH_Lock();
|
||||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
|
@ -174,7 +174,11 @@ void jump_to_app() {
|
|||||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||||
|
|
||||||
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
||||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
// Look at cm3_vectors struct in startup. In a fw image the first uint32_t contains the address of the top of irqstack
|
||||||
|
uint32_t fwIrqStackBase = (*(__IO uint32_t*) bdinfo->fw_base) & 0xFFFE0000;
|
||||||
|
// Check for the two possible irqstack locations (sram or core coupled sram)
|
||||||
|
if ( fwIrqStackBase == 0x20000000 || fwIrqStackBase == 0x10000000) {
|
||||||
|
/* Jump to user application */
|
||||||
FLASH_Lock();
|
FLASH_Lock();
|
||||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
|
@ -174,7 +174,11 @@ void jump_to_app() {
|
|||||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||||
|
|
||||||
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
||||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
// Look at cm3_vectors struct in startup. In a fw image the first uint32_t contains the address of the top of irqstack
|
||||||
|
uint32_t fwIrqStackBase = (*(__IO uint32_t*) bdinfo->fw_base) & 0xFFFE0000;
|
||||||
|
// Check for the two possible irqstack locations (sram or core coupled sram)
|
||||||
|
if ( fwIrqStackBase == 0x20000000 || fwIrqStackBase == 0x10000000) {
|
||||||
|
/* Jump to user application */
|
||||||
FLASH_Lock();
|
FLASH_Lock();
|
||||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user