trezorhal: don't set SCB->VTOR in SystemInit

pull/25/head
Pavol Rusnak 7 years ago
parent 7da63a36e2
commit d3ec688d6f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -44,19 +44,19 @@ testpy: ## run selected unit tests from python-trezor
build: build_bootloader build_loader build_firmware build_unix build_cross ## build all
build_bootloader: vendor ## build bootloader
build_bootloader: ## build bootloader
$(MAKE) -f Makefile.bootloader $(TREZORHAL_PORT_OPTS)
build_loader: vendor ## build loader
build_loader: ## build loader
$(MAKE) -f Makefile.loader $(TREZORHAL_PORT_OPTS)
build_firmware: vendor res build_cross ## build firmware with frozen modules
build_firmware: res build_cross ## build firmware with frozen modules
$(MAKE) -f Makefile.firmware $(TREZORHAL_PORT_OPTS)
build_unix: vendor ## build unix port
build_unix: ## build unix port
$(MAKE) -f ../../../micropython/unix/Makefile -C vendor/micropython/unix $(UNIX_PORT_OPTS)
build_cross: vendor ## build mpy-cross port
build_cross: ## build mpy-cross port
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
## clean commands:

@ -5,8 +5,6 @@
#include "crypto.h"
#define FLASH_BASE 0x08000000
bool parse_header(const uint8_t *data, uint32_t *codelen, uint8_t *sigidx, uint8_t *sig)
{
uint32_t magic;

@ -8,8 +8,6 @@
#include "display.h"
#include "sdcard.h"
#define LOADER_START 0x08010000
#define BOOTLOADER_FGCOLOR 0xFFFF
#define BOOTLOADER_BGCOLOR 0x0000
@ -116,6 +114,7 @@ bool copy_sdcard(void)
int main(void)
{
SCB->VTOR = BOOTLOADER_START;
periph_init();
sdcard_init();

@ -24,6 +24,7 @@
int main(void) {
SCB->VTOR = FIRMWARE_START;
periph_init();
pendsv_init();

@ -3,8 +3,6 @@
#include "common.h"
#include "display.h"
#define FIRMWARE_START 0x08020000
#define LOADER_FGCOLOR 0xFFFF
#define LOADER_BGCOLOR 0x0000
@ -17,6 +15,7 @@ void pendsv_isr_handler(void) {
int main(void)
{
SCB->VTOR = LOADER_START;
periph_init();
display_init();

@ -3,6 +3,10 @@
#include <stdint.h>
#define BOOTLOADER_START 0x08000000
#define LOADER_START 0x08010000
#define FIRMWARE_START 0x08020000
void periph_init(void);
void __attribute__((noreturn)) nlr_jump_fail(void *val);

@ -144,13 +144,6 @@ const uint32_t MSIRangeTable[12] = {100000, 200000, 400000, 800000, 1000000, 200
/************************* Miscellaneous Configuration ************************/
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
/******************************************************************************/
/**
* @}
*/
@ -229,13 +222,6 @@ void SystemInit(void)
RCC->CIER = 0x00000000;
#endif
/* Configure the Vector Table location add offset address ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM1_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif
/* dpgeorge: enable 8-byte stack alignment for IRQ handlers, in accord with EABI */
SCB->CCR |= SCB_CCR_STKALIGN_Msk;
}

Loading…
Cancel
Save