place at directive

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

place at directive

Jump to solution
625 Views
SreejithN
Contributor I

I am using s32k146 for my current project. There is a requirement to allocate 1KB of specified RAM memory that should not be initialized by the start-up file. So that i have declared a variable as shown below.

__no_init volatile uint32_t var[256] @0x200EC00

 

But the IAR compiler throws an error as blow

unable to complete "place at" directives with a total estimated minimum size of 0x0 bytes in <> (total space 0x0).

 

Please help to resolve the issue and if possible give an example to use place at directive for an noint section.

0 Kudos
Reply
1 Solution
614 Views
prakashram72
Contributor III

Hi @SreejithN ,

The error message you're seeing is typically due to the memory region you're trying to allocate not being defined in the linker file. The IAR compiler doesn't know where to place the variable because it doesn't have information about the memory region at 0x200EC00.

Firstly, you need to ensure that the memory region at 0x200EC00 is defined in your linker file. You can do this by adding a section in your linker file like this:

 define region RAM_region = mem:[from 0x200EC00 size 0x400]; 

Then, you can use the __no_init attribute and place at directive to allocate the variable in the specified memory region. Here's an example:

 #pragma location = 'RAM_region' __no_init volatile uint32_t var[256]; 

Also, make sure that the size of the memory region you're defining in the linker file is large enough to accommodate the variable you're trying to allocate. In your case, you're trying to allocate 1KB of memory, so the size of the memory region should be at least 0x400 (1KB).

For more information on how to use the __no_init attribute and place at directive, you can refer to the S32K Knowledge Base article on the community.nxp.com website.

View solution in original post

0 Kudos
Reply
1 Reply
615 Views
prakashram72
Contributor III

Hi @SreejithN ,

The error message you're seeing is typically due to the memory region you're trying to allocate not being defined in the linker file. The IAR compiler doesn't know where to place the variable because it doesn't have information about the memory region at 0x200EC00.

Firstly, you need to ensure that the memory region at 0x200EC00 is defined in your linker file. You can do this by adding a section in your linker file like this:

 define region RAM_region = mem:[from 0x200EC00 size 0x400]; 

Then, you can use the __no_init attribute and place at directive to allocate the variable in the specified memory region. Here's an example:

 #pragma location = 'RAM_region' __no_init volatile uint32_t var[256]; 

Also, make sure that the size of the memory region you're defining in the linker file is large enough to accommodate the variable you're trying to allocate. In your case, you're trying to allocate 1KB of memory, so the size of the memory region should be at least 0x400 (1KB).

For more information on how to use the __no_init attribute and place at directive, you can refer to the S32K Knowledge Base article on the community.nxp.com website.

0 Kudos
Reply