This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HeapBuf memory allocation problem

Other Parts Discussed in Thread: TMS320C6672

hello All,

I came to a problem where i can't allocate my data using HeapBuf. The code was working before in an idle thread but had to be created on interrupt basis. While it was working in idle I didn't need to use HeapBuf because malloc() does work there. When using malloc, the code worked completely. Then after I discovered that I needed to use a Heap when working in an interrupt I rebuild my code using HeapBuf_alloc().

I tried using the HeapBuf_alloc() in the idle loop as well as in the interrupt.

The problem is that when I use the HeapBuf I wont get a pointer nor a error in the error_block.

Things I think that you will need from me:

DSP: TMS320C6672

CFG code:

var heapBuf0Params = new HeapBuf.Params();
heapBuf0Params.instance.name = "RAM_BUFF";
heapBuf0Params.blockSize = 65536;
heapBuf0Params.numBlocks = 46;
heapBuf0Params.sectionName = "DDR3";
heapBuf0Params.align = 0;
Program.global.RAM_BUFF = HeapBuf.create(heapBuf0Params);
Program.sectMap["DDR3"] = new Program.SectionSpec();
Program.sectMap["DDR3"].loadSegment = "DDR3";
My C code Where the problem is:

SimpleXmlParserState parser= HeapBuf_alloc(RAM_BUFF, sizeof(TSimpleXmlParserState), 0, eb);
		if (parser == NULL) {
			return NULL;
		}