Here is a working example.

https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/stm32h7/stm32_spi.c#L715-L716

https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld#L179-L184

You can check it the arm-none-eabi-nm -C nuttx.elf | grep g_mcan0_msgram

David

-----Original Message-----
From: Tim Hardisty [mailto:t...@jti.uk.com.INVALID]
Sent: Tuesday, June 08, 2021 4:23 AM
To: dev@nuttx.apache.org
Subject: Re: Memory locations


On 07/06/2021 19:06, Nathan Hartman wrote:
> On Mon, Jun 7, 2021 at 12:24 PM Tim wrote:
>> I will, I believe, need to declare - place - MCAN related structures such
>> that they (or at least some elements of them) are in SRAM.
>>
> Yes. It is possible. It is done by adding attributes in the code which
> tell the compiler that an object should be located at a particular
> address or section.

I have added this to my linker script (and other variations on that
theme, all of which compile OK with no warnings or errors)

     .isramdata :
     {
     } > isram

and declared

static uint32_tg_mcan0_msgram[MCAN0_MSGRAM_WORDS]
__attribute__((section(".isramdata"))) = {0};
But it does not place the array in isram :(
system.map states: 20053fc4 D g_mcan0_msgram
which is confirmed by the debugger and an info debug message
Is there anything overruling this? Or a silly mistake, given my
inexperience with linker scripts?
Any guidance much appreciated!

Reply via email to