Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST-DISCO_L475VG_IOT01A: Improve SRAM use for IAR toolchain #5844

Merged
merged 1 commit into from
Jan 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__]
define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__];
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];

/* Stack 1/8 and Heap 1/4 of RAM */
define symbol __size_cstack__ = 0x8000;
define symbol __size_heap__ = 0xa000;
/* Stack complete SRAM2 and Heap 2/3 of SRAM1 */
define symbol __size_cstack__ = 0x7e00;
define symbol __size_heap__ = 0x10000;
define block CSTACK with alignment = 8, size = __size_cstack__ { };
define block HEAP with alignment = 8, size = __size_heap__ { };
define block STACKHEAP with fixed order { block HEAP, block CSTACK };

initialize by copy with packing = zeros { readwrite };
do not initialize { section .noinit };

place at address mem:__intvec_start__ { readonly section .intvec };

place in ROM_region { readonly };
place in SRAM1_region { readwrite, block STACKHEAP };
place in SRAM2_region { };
place in SRAM1_region { readwrite, block HEAP };
place in SRAM2_region { block CSTACK };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but shouldn't we add the readwrite keyword ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bcostm Bruno
Your suggestion seemed good to me, but it does not link
It gives a long list of ambigous section match like this one
Error[Lc037]: ambiguous section match: "zi section .bss in main.o" matches more than one pattern "rw" (at line 36 of "C:/MCDGit7/mbed-os/BUILD/tests/DISCO_L475VG_IO T01A/IAR/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4 75xG/device/TOOLCHAIN_IAR/stm32l475xx.icf") "rw" (at line 37 of "C:/MCDGit7/mbed-os/BUILD/tests/DISCO_L475VG_IO T01A/IAR/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4 75xG/device/TOOLCHAIN_IAR/stm32l475xx.icf")
Is there any reason for asking this extra readwrite keyword ?

Cheers
Armelle

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, readwrite specifies: Place .data, .bss, and .noinit. Therefore the linking error

It is good as it is