Home/Support/Support Forum/How to access 512KB Battery-Backable SRAM in RCM 6760
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to access 512KB Battery-Backable SRAM in RCM 6760

0 votes
Hi.
I tried to use _xalloc and XALLOC_BB in parameter3 but it doesn't work and gave me the error bellow :

Run Time Error:Xmem allocation failed (out of memory)..
file:MEM.LIB
function: _xalloc
line:400

I'm trying to allocate 15000 bytes.

pszGER = _xalloc(szGER+szNOME+szTD+szSet+szL1L2+szSR+szER+szVIR+szCC+szAER+szANA+szFER,0, XALLOC_BB);
asked Feb 19, 2016 in Rabbit Software by sshamali New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

+1 vote
The first parameter for _xalloc is a pointer to an long integer as the function may return a larger block and will update the long at that location with the actual amount allocated so you should have something like:

long block_size;

block_size = szGER+szNOME+szTD+szSet+szL1L2+szSR+szER+szVIR+szCC+szAER+szANA+szFER;

pszGER = _xalloc(&block_size,0, XALLOC_BB);

Regards,
Peter
answered Feb 19, 2016 by petermcs Veteran of the Digi Community (1,130 points)
...