Hello-
We are working with :
SEGGER Embedded Studio for ARM
Release 7.12a Build 2023031402.52776
Windows x64
We are compiling 3rd-party code that uses the USB peripheral on the STM32L062. This code is expecting the linker to define a section for the USB's PMA memory area and auto-generate symbol __pma_end__, however, despite our attempts to edit the link process we constantly get errors that this symbol is not defined. After reading the Segger Wiki page covering the memory map XML format :
wiki.segger.com/Add_new_Memory_Sections_and_Segments
The memory map XML file now looks like this:
And a separate XML file for section placement looks like this:
Originally we tried combining these two sections into one file, but that did not work. The wiki says "The Section Placement File to use is set in the Project Options -> Code -> Linker -> Section Placement File", however, when we check these options, there is only a place to specify the Memory Map File, not one for Section Placement. At this stage we don't know what else to try to correctly define the PMA memory section needed and get the __pma_end__ symbol generated. As an additional point of reference, the original source code used the old-style LD files and did this to create the PMA section :
Display All
Changing the project options to use the older LD file style of linking did not help as the __pma_end__ symbol was still not generated.
We are working with :
SEGGER Embedded Studio for ARM
Release 7.12a Build 2023031402.52776
Windows x64
We are compiling 3rd-party code that uses the USB peripheral on the STM32L062. This code is expecting the linker to define a section for the USB's PMA memory area and auto-generate symbol __pma_end__, however, despite our attempts to edit the link process we constantly get errors that this symbol is not defined. After reading the Segger Wiki page covering the memory map XML format :
wiki.segger.com/Add_new_Memory_Sections_and_Segments
The memory map XML file now looks like this:
XML Source Code
- <!DOCTYPE Board_Memory_Definition_File>
- <root name="STM32L062K8Ux">
- <MemorySegment name="FLASH1" start="0x08000000" size="0x00010000" access="ReadOnly" />
- <MemorySegment name="RAM1" start="0x20000000" size="0x00002000" access="Read/Write" />
- <MemorySegment name="PMA" start="0x40006000" size="0x00000200" access="Write" />
- </root>
And a separate XML file for section placement looks like this:
Source Code
- MEMORY
- {
- FLASH (RX) : ORIGIN = 0x08000000, LENGTH = 8K
- EEPROM (W) : ORIGIN = 0x08080000, LENGTH = 256
- RAM (W!RX) : ORIGIN = 0x20000000, LENGTH = 8K
- PMA (W) : ORIGIN = 0x40006000, LENGTH = 512 /* 256 x 16bit */
- }
- /*
- ...lots of other stuff from the LD file not included
- */
- /* USB/CAN Packet Memory Area (PMA) */
- .pma :
- {
- _pma_start = .; /* Start of PMA in real memory space */
- . = ALIGN(2);
- *(.pma)
- *(.pma*)
- . = ALIGN(2);
- _pma_end = .; /* End of PMA in PMA space */
- } > PMA