mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
Fix build for N0100 and legacy N0110
This commit is contained in:
@@ -3,6 +3,7 @@ ion_device_src += $(addprefix ion/src/device/bootloader/drivers/, \
|
||||
board.cpp \
|
||||
cache.cpp \
|
||||
external_flash_tramp.cpp \
|
||||
storage.cpp \
|
||||
led.cpp \
|
||||
power.cpp \
|
||||
reset.cpp \
|
||||
|
||||
@@ -58,7 +58,7 @@ SECTIONS {
|
||||
} > FLASH
|
||||
|
||||
.recovery_boot : {
|
||||
. = ORIGIN(FLASH) + USERLAND_OFFSET + 0x100;
|
||||
. = ORIGIN(FLASH) + USERLAND_OFFSET + 0x80;
|
||||
KEEP(*(.recovery_boot));
|
||||
} >FLASH
|
||||
|
||||
|
||||
10
ion/src/device/bootloader/drivers/storage.cpp
Normal file
10
ion/src/device/bootloader/drivers/storage.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <ion/storage.h>
|
||||
|
||||
namespace Ion {
|
||||
|
||||
// TODO: Check if the storage is initialized at runtime and not at compile time:
|
||||
// As far as I can see, it break build for N0110 legacy internal storage and
|
||||
// N0100 due to lack of storage, so it's probably wasting space.
|
||||
uint32_t __attribute__((section(".static_storage"))) staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0};
|
||||
|
||||
}
|
||||
@@ -71,6 +71,7 @@ SECTIONS {
|
||||
*(.text.__assert)
|
||||
*(.text.memcpy)
|
||||
*(.text.memset)
|
||||
*(.text.__udivmoddi4)
|
||||
/*
|
||||
*(.text.strlen)
|
||||
*(.text.strncmp)
|
||||
|
||||
@@ -23,10 +23,10 @@ MEMORY {
|
||||
* overwritten (for instance, vtables that live in the .rodata section). */
|
||||
|
||||
/* The image is quite large too!
|
||||
* So we put the stack to 18K so there's still space
|
||||
* So we put the stack to 17K so there's still space
|
||||
* for our image, if not LD will throw an error. */
|
||||
|
||||
STACK_SIZE = 18K;
|
||||
STACK_SIZE = 17K;
|
||||
|
||||
SECTIONS {
|
||||
.isr_vector_table ORIGIN(RAM_BUFFER) : {
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
namespace Ion {
|
||||
|
||||
uint32_t __attribute__((section(".static_storage"))) staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0};
|
||||
// Declaration for N0110 with bootloader is in ion/src/device/bootloader/drivers/storage.cpp
|
||||
// to fix LD build
|
||||
__attribute__((weak)) uint32_t staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0};
|
||||
|
||||
Storage * Storage::sharedStorage() {
|
||||
static Storage * storage = new (staticStorageArea) Storage();
|
||||
|
||||
Reference in New Issue
Block a user