Skip to content

stm32l475: lwip symbols in sram1 #9793

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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 @@ -61,6 +61,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
}
RW_IRAM1 MBED_RAM0_START MBED_RAM0_SIZE-Stack_Size { ; RW data 96k L4-SRAM1
.ANY (+RW, +Last)
lwip* (+ZI)
Copy link

@deepikabhavnani deepikabhavnani Mar 6, 2019

Choose a reason for hiding this comment

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

ARM compiler supports expansion of RW and ZI in multiple banks, please try below solution

RW_IRAM1 MBED_RAM0_START MBED_RAM0_SIZE-Stack_Size  { ; RW data 96k L4-SRAM1
   .ANY (+RW +ZI)
  }
 ; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
  RW_IRAM2 (0x10000000+0x188) (0x08000-0x188)  {  ; ZI data 32k L4-ECC-SRAM2
   .ANY (+RW +ZI)
  }

}
; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM
RW_IRAM2 (0x10000000+0x188) (0x08000-0x188) { ; ZI data 32k L4-ECC-SRAM2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ SECTIONS
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
} > SRAM1

.lwip :
{
. = ALIGN(8);
__lwip_bss_start__ = .;
*mbed-os/features/lwipstack*.o(.bss*)
*mbed-os/features/lwipstack*.o(COMMON)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think LWIP is a defaut feature on all L475 based boards - will that work fine anyway when there are no LWIP symbols at all (mbed2 application for instance)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should work, I tested this precise use case by disabling lwip. I saw no ill effects. Can't comment for mbed2, though.

. = ALIGN(8);
__lwip_bss_end__ = .;
} > SRAM1

.data : AT (__etext)
{
__data_start__ = .;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ LoopCopyDataInit:
cmp r2, r3
bcc CopyDataInit

/* Zero LWIP .bss section in second RAM region */
ldr r1, =__lwip_bss_start__
ldr r2, =__lwip_bss_end__

movs r0, 0

LWIPBssInit:
cmp r1, r2
itt lt
strlt r0, [r1], #4
blt LWIPBssInit

/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
}

define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
define symbol __size_heap__ = 0x17000;
define symbol __size_heap__ = 0x13C00;
define block CSTACK with alignment = 8, size = __size_cstack__ { };
define block HEAP with alignment = 8, size = __size_heap__ { };
define block HEAP with expanding size, minimum size = __size_heap__, alignment = 8 { };

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 HEAP };
place in SRAM1_region { readwrite, zeroinit object *lwip*.o, block HEAP };
place in SRAM2_region { first block CSTACK, zeroinit };