Allocation particular RAM memory for a list of variables

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I am facing an issue with allocation some variable at fixed memory location in RAM memory using the TC277TE and Tasking compiler ver 2.0r2.

Allocation of a variable using the __at (
) is possible , But for allocating around 20 variables sequentially is not happening.

Can somebody suggest a method for this using any modification in the LSL file and #pragma.


Regards
Veeresh
0 Likes
1 Reply
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received
It's usually easier to use #pragma to declare many variables within the same section. Refer to Tasking's ctc_user_guide.pdf, section 8.8.8 The Section Layout Definition: Locating Sections.

Quick example:


//c file
#pragma section all "my_fixed_section"
int fixed_variable1;
int fixed_variable2;
#pragma section all



// lsl file
memory my_fixed_address
{
mau = 8;
size = 1k;
type = ram;
map( dest=bus:spe:fpi_bus, dest_offset=0x7001D000, size=1k );
}
group ( ordered, run_addr = mem:my_fixed_address )
{
select ".zbss.my_fixed_section";
}
0 Likes