diff --git a/SConscript.boardloader b/SConscript.boardloader index d5a73c124..b1798ff74 100644 --- a/SConscript.boardloader +++ b/SConscript.boardloader @@ -104,7 +104,7 @@ env.Replace( '-fstack-protector-all -ffreestanding ' + CCFLAGS_MOD, CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB', - LINKFLAGS='-nostdlib -T embed/boardloader/memory.ld --gc-sections', + LINKFLAGS='-nostdlib -T embed/boardloader/memory.ld --gc-sections -Map=build/boardloader/boardloader.map', CPPPATH=[ 'embed/boardloader', 'embed/trezorhal', diff --git a/embed/trezorhal/common.c b/embed/trezorhal/common.c index 82f0d02ed..ff79fc0f5 100644 --- a/embed/trezorhal/common.c +++ b/embed/trezorhal/common.c @@ -30,7 +30,7 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, for (;;); } -uint32_t __stack_chk_guard; +uint32_t __stack_chk_guard = 0; void __attribute__((noreturn)) __stack_chk_fail(void) { diff --git a/embed/trezorhal/stm32.c b/embed/trezorhal/stm32.c index 27f9e2872..4bee9fc77 100644 --- a/embed/trezorhal/stm32.c +++ b/embed/trezorhal/stm32.c @@ -41,13 +41,9 @@ void SystemInit(void) SCB->CPACR |= ((3U << 22) | (3U << 20)); } +volatile uint32_t uwTick = 0; + void SysTick_Handler(void) { - extern volatile uint32_t uwTick; uwTick += 1; - // TODO: verify the following claim, or remove - // Read the systick control regster. This has the side effect of clearing - // the COUNTFLAG bit, which makes the logic in sys_tick_get_microseconds - // work properly. - SysTick->CTRL; }