Skip to content

Commit

Permalink
Rework linker files for STM32 targets (nanoframework#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Jun 12, 2018
1 parent 00e897d commit d9ed5fd
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 24 deletions.
7 changes: 5 additions & 2 deletions targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ nf_set_linker_options(${NANOCLR_PROJECT_NAME}.elf TRUE)
###################################################
# the size of the CLR managed heap is defined here
###################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x1000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x2800")
############################################################################
# CRT heap is assigned to RAM4 region @ CCM SRAM so we are OK to use it all
############################################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x10000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x10000")

# generate output files
nf_generate_build_output_files(${NANOBOOTER_PROJECT_NAME}.elf)
Expand Down
2 changes: 1 addition & 1 deletion targets/CMSIS-OS/ChibiOS/MBN_QUAIL/nanoBooter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
2 changes: 1 addition & 1 deletion targets/CMSIS-OS/ChibiOS/MBN_QUAIL/nanoCLR/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 4096, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
7 changes: 5 additions & 2 deletions targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ nf_set_linker_options(${NANOCLR_PROJECT_NAME}.elf TRUE)
###################################################
# the size of the CLR managed heap is defined here
###################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x1000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x2800")
############################################################################
# CRT heap is assigned to RAM4 region @ CCM SRAM so we are OK to use it all
############################################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x10000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x10000")

# generate output files
nf_generate_build_output_files(${NANOBOOTER_PROJECT_NAME}.elf)
Expand Down
2 changes: 1 addition & 1 deletion targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/nanoBooter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
2 changes: 1 addition & 1 deletion targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/nanoCLR/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ REGION_ALIAS("DATA_RAM_LMA", flash);
REGION_ALIAS("BSS_RAM", ram3);

/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
REGION_ALIAS("HEAP_RAM", ram3);

/* RAM region to be used for the nanoFramework CLR managed heap.*/
REGION_ALIAS("CLR_MANAGED_HEAP_RAM", ram0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
2 changes: 1 addition & 1 deletion targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ __IO uint32_t vectorTable[48] __attribute__((section(".RAMVectorTable")));
///////////////////////////////////////////////////////////////////////////////////////////

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ nf_set_linker_options(${NANOCLR_PROJECT_NAME}.elf TRUE)
###################################################
# the size of the CLR managed heap is defined here
###################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x1000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x2800")
############################################################################
# CRT heap is assigned to RAM4 region @ CCM SRAM so we are OK to use it all
############################################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x10000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x10000")

# generate output files
nf_generate_build_output_files(${NANOBOOTER_PROJECT_NAME}.elf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
8 changes: 5 additions & 3 deletions targets/CMSIS-OS/ChibiOS/ST_STM32F4_DISCOVERY/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ nf_set_linker_options(${NANOCLR_PROJECT_NAME}.elf TRUE)
# add other linker flags
###################################################
# the size of the CLR managed heap is defined here
###################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x1000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x2800")
############################################################################
# CRT heap is assigned to RAM4 region @ CCM SRAM so we are OK to use it all
############################################################################
set_property(TARGET ${NANOBOOTER_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x400,--defsym=__crt_heap_size__=0x10000")
set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAGS ",--defsym=__main_stack_size__=0x400,--defsym=__process_stack_size__=0x800,--defsym=__crt_heap_size__=0x10000")

# generate output files
nf_generate_build_output_files(${NANOBOOTER_PROJECT_NAME}.elf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void BlinkerThread(void const * argument)
osThreadDef(BlinkerThread, osPriorityNormal, 128, "BlinkerThread");

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");

// Application entry point.
int main(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <targetPAL.h>

// need to declare the Receiver thread here
osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread");
// declare CLRStartup thread here
osThreadDef(CLRStartupThread, osPriorityNormal, 4096, "CLRStartupThread");

Expand Down

0 comments on commit d9ed5fd

Please sign in to comment.