memory org and solo hacker build recipe

This commit is contained in:
Conor Patrick 2018-12-05 00:13:34 -05:00
parent cbf021c7a8
commit b9ebde22e5
6 changed files with 18 additions and 18 deletions

View File

@ -1,20 +1,26 @@
ifndef DEBUG
DEBUG=0
endif
all: all:
$(MAKE) -f application.mk -j8 solo.hex $(MAKE) -f application.mk -j8 solo.hex DEBUG=$(DEBUG)
debug: all-hacker:
$(MAKE) -f application.mk -j8 solo.hex DEBUG=1 $(MAKE) -f application.mk -j8 solo.hex EXTRA_DEFINES='-DSOLO_HACKER'
debugboot-app: debugboot-app:
$(MAKE) -f application.mk -j8 solo.hex DEBUG=1 \ $(MAKE) -f application.mk -j8 solo.hex DEBUG=1 \
LDSCRIPT=linker/stm32l4xx_extra.ld EXTRA_DEFINES='-DAPPLICATION_START_PAGE=16' LDSCRIPT=linker/stm32l4xx_extra.ld EXTRA_DEFINES='-DAPPLICATION_START_PAGE=16 -DSOLO_HACKER'
debugboot-boot: debugboot-boot:
$(MAKE) -f bootloader.mk -j8 bootloader.hex DEBUG=1 \ $(MAKE) -f bootloader.mk -j8 bootloader.hex DEBUG=1 \
LDSCRIPT=linker/bootloader_stm32l4xx_extra.ld EXTRA_DEFINES='-DAPPLICATION_START_PAGE=16' LDSCRIPT=linker/bootloader_stm32l4xx_extra.ld EXTRA_DEFINES='-DAPPLICATION_START_PAGE=16 -DSOLO_HACKER'
boot: boot:
$(MAKE) -f bootloader.mk -j8 bootloader.hex $(MAKE) -f bootloader.mk -j8 bootloader.hex DEBUG=$(DEBUG)
boot-hacker:
$(MAKE) -f bootloader.mk -j8 bootloader.hex EXTRA_DEFINES='-DSOLO_HACKER'
clean: clean:
$(MAKE) -f application.mk clean $(MAKE) -f application.mk clean
@ -28,7 +34,7 @@ flash: solo.hex bootloader.hex
flash_dfu: solo.hex bootloader.hex flash_dfu: solo.hex bootloader.hex
python merge_hex.py solo.hex bootloader.hex all.hex python merge_hex.py solo.hex bootloader.hex all.hex
# STM32_Programmer_CLI -c port=usb1 -halt -e all --readunprotect # STM32_Programmer_CLI -c port=usb1 -halt -e all --readunprotect
STM32_Programmer_CLI -c port=usb1 -halt -d all.hex STM32_Programmer_CLI -c port=usb1 -halt -rdu -d all.hex
flashboot: solo.hex bootloader.hex flashboot: solo.hex bootloader.hex
python merge_hex.py solo.hex bootloader.hex all.hex python merge_hex.py solo.hex bootloader.hex all.hex

View File

@ -15,8 +15,6 @@
#define IS_BOOTLOADER 1 #define IS_BOOTLOADER 1
#define SOLO_HACKER
#define ENABLE_U2F_EXTENSIONS #define ENABLE_U2F_EXTENSIONS
// #define ENABLE_U2F // #define ENABLE_U2F
@ -53,6 +51,7 @@ void hw_init(void);
void device_reboot(); void device_reboot();
int is_authorized_to_boot(); int is_authorized_to_boot();
int is_bootloader_disabled();
void bootloader_heartbeat(); void bootloader_heartbeat();
#endif #endif

View File

@ -41,7 +41,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */ /* Specify the memory areas */
MEMORY MEMORY
{ {
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 14K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 20K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
SRAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K SRAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
} }

View File

@ -42,7 +42,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
MEMORY MEMORY
{ {
/* First 14 KB is bootloader */ /* First 14 KB is bootloader */
FLASH (rx) : ORIGIN = 0x08003800, LENGTH = 204K-8 /* Leave out 38 Kb at end for data */ FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 198K-8 /* Leave out 38 Kb at end for data */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
SRAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K SRAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16K
} }

View File

@ -13,11 +13,6 @@
#define BOOT_TO_DFU 0 #define BOOT_TO_DFU 0
// Uncomment SOLO_HACKKER to Only use level 1 read-out-protection,
// allows booting to ST bootloader or Solo bootloader without any button press,
// Disables signature check in Solo bootloader.
#define SOLO_HACKER
//#define USING_DEV_BOARD //#define USING_DEV_BOARD
//#define ENABLE_U2F_EXTENSIONS //#define ENABLE_U2F_EXTENSIONS

View File

@ -21,7 +21,7 @@
// Start of application code // Start of application code
#ifndef APPLICATION_START_PAGE #ifndef APPLICATION_START_PAGE
#define APPLICATION_START_PAGE (7) #define APPLICATION_START_PAGE (10)
#endif #endif
#define APPLICATION_START_ADDR (0x08000000 + ((APPLICATION_START_PAGE)*PAGE_SIZE)) #define APPLICATION_START_ADDR (0x08000000 + ((APPLICATION_START_PAGE)*PAGE_SIZE))
@ -31,6 +31,6 @@
#define APPLICATION_END_ADDR ((0x08000000 + ((APPLICATION_END_PAGE)*PAGE_SIZE))-8) #define APPLICATION_END_ADDR ((0x08000000 + ((APPLICATION_END_PAGE)*PAGE_SIZE))-8)
// Bootloader state. // Bootloader state.
#define AUTH_WORD_ADDR ((0x08000000 + ((APPLICATION_END_PAGE)*PAGE_SIZE))-8) #define AUTH_WORD_ADDR (APPLICATION_END_ADDR)
#endif #endif