AnsweredAssumed Answered

Processor expert CSTACK placement in icf file

Question asked by Adrian Rockall on Feb 27, 2015
Latest reply on Mar 2, 2015 by Vojtech Filip

Hi,

 

I have generated a new project using Processor Expert using the KSDK 1.1. and I have added the MQX standard component plus others. I have then connected this to an IAR project and built it.

After getting what I believe are the correct pre-processor settings etc. have got it to compile but was getting random Hard fault interrupts.

Eventually I have tracked this down to the a bad heap settings.

 

In bsp_config.h there is the following:

#define __HEAP_START Image$$ARM_LIB_HEAP$$Base
#define __HEAP_END Image$$ARM_LIB_STACK$$ZI$$Limit

 

In the icf file the following is generated:

 

place in DATA_region { readwrite, block CSTACK, block HEAP};

 

This means the heap end is before the heap start and the lwmem thinks the heap is huge and incorrectly placed so memory allocations overwrite the kernel_data. I have unchecked the option to generate the icf file and changed the line as follows:

 

place in DATA_region { readwrite, block HEAP, block CSTACK };

 

Now the heap size and location is correct and all works well.

 

I believe this is a bug in the processor Expert but if anyone knows that I am doing something wrong then I would like to know.

 

Best regards,

Adrian.

Outcomes