code cleanup 2: explicit .bss, linker map, and simpler systick

This commit is contained in:
mcudev 2017-10-14 18:08:15 -04:00 committed by Pavol Rusnak
parent 5b634098d9
commit a1c33e32f0
3 changed files with 4 additions and 8 deletions

View File

@ -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',

View File

@ -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)
{

View File

@ -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;
}