Skip to content

BSP incorrectly uses hard-coded FLASH_BASE in HAL startup sequence #148

@terrillmoore

Description

@terrillmoore

This line:

SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */

incorrectly assumes that the flash vectors are at location zero. This is not true if a stage two bootloader is used. The actual address of the vector table can be easily found and should be used instead of a macro. FLASH_BASE cannot be changed as it's used all over the BSP. The error is not that FLASH_BASE is wrong, but rather that it's being used here.

Same mistake also appears in the templates; but these are not being used (and the source templates could be removed to avoid confusion):

SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions