| From 470dee13bffc0adb9a778d56fab3028031f71e80 Mon Sep 17 00:00:00 2001 |
| From: TFLM <tflm@google.com> |
| Date: Fri, 28 Oct 2022 11:01:15 +0200 |
| Subject: [PATCH] TFLM patch |
| |
| --- |
| targets/corstone-300/platform.ld | 8 +++----- |
| targets/corstone-300/platform.scatter | 5 +++-- |
| targets/corstone-300/retarget.c | 16 ++++++++-------- |
| 3 files changed, 14 insertions(+), 15 deletions(-) |
| |
| diff --git a/targets/corstone-300/platform.ld b/targets/corstone-300/platform.ld |
| index ec58acc..21316a4 100644 |
| --- a/targets/corstone-300/platform.ld |
| +++ b/targets/corstone-300/platform.ld |
| @@ -75,7 +75,7 @@ |
| #define ETHOSU_ARENA 1 |
| #endif |
| |
| -__STACK_SIZE = 0x00008000; |
| +__STACK_SIZE = 0x00030000; |
| __HEAP_SIZE = 0x00008000; |
| |
| MEMORY |
| @@ -150,9 +150,6 @@ SECTIONS |
| *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
| *(SORT(.dtors.*)) |
| *(.dtors) |
| - |
| - *(.rodata*) |
| - |
| KEEP(*(.eh_frame*)) |
| } > ITCM :rom_exec |
| |
| @@ -275,6 +272,7 @@ SECTIONS |
| *(network_model_sec) |
| #endif |
| * (expected_output_data_sec) |
| + *(.rodata*) |
| } > DDR :rom_dram |
| |
| __eddr_data = ALIGN (16) ; |
| @@ -293,7 +291,7 @@ SECTIONS |
| *(COMMON) |
| . = ALIGN(4); |
| __bss_end__ = .; |
| - } > DTCM :null |
| + } > SRAM :null |
| |
| .heap (COPY) : |
| { |
| diff --git a/targets/corstone-300/platform.scatter b/targets/corstone-300/platform.scatter |
| index fab12d1..be5c227 100644 |
| --- a/targets/corstone-300/platform.scatter |
| +++ b/targets/corstone-300/platform.scatter |
| @@ -1,3 +1,4 @@ |
| +#!cpp |
| /* |
| * Copyright (c) 2019-2021 Arm Limited. All rights reserved. |
| * |
| @@ -76,7 +77,7 @@ |
| #endif |
| |
| #ifndef STACK_SIZE |
| -#define STACK_SIZE 0x8000 |
| +#define STACK_SIZE 0x20000 |
| #endif |
| |
| #ifndef HEAP_SIZE |
| @@ -136,7 +137,6 @@ APP_IMAGE LR_START LR_SIZE |
| ; Make sure reset_handler ends up in root segment, when split across |
| ; ITCM and DTCM |
| startup_ARMCM55.o |
| - .ANY (+RO) |
| } |
| |
| #if defined(USE_TRUSTZONE) && defined(TRUSTZONE_SECURE) |
| @@ -209,6 +209,7 @@ LOAD_REGION_1 DDR_START DDR_SIZE |
| * (input_data_sec) |
| * (expected_output_data_sec) |
| * (output_data_sec) |
| + .ANY (+RO) |
| } |
| |
| #if (ETHOSU_ARENA == 1) |
| diff --git a/targets/corstone-300/retarget.c b/targets/corstone-300/retarget.c |
| index 4bde44d..b510ad8 100644 |
| --- a/targets/corstone-300/retarget.c |
| +++ b/targets/corstone-300/retarget.c |
| @@ -172,14 +172,6 @@ long RETARGET(_flen)(FILEHANDLE fh) { |
| return -1; |
| } |
| |
| -int RETARGET(_tmpnam)(char *name, int sig, unsigned maxlen) { |
| - (void)name; |
| - (void)sig; |
| - (void)maxlen; |
| - |
| - return 1; |
| -} |
| - |
| char *RETARGET(_command_string)(char *cmd, int len) { |
| (void)len; |
| |
| @@ -274,3 +266,11 @@ int ferror(FILE *f) { |
| return EOF; |
| } |
| #endif |
| + |
| +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) |
| +#else |
| +void RETARGET(exit)(int return_code) { |
| + RETARGET(_exit)(return_code); |
| + while (1) {} |
| +} |
| +#endif |
| -- |
| 2.17.1 |
| |