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.

Large calloc in CCSv5?

Other Parts Discussed in Thread: MSP430F5438, MSP430F5359

I am writing software on a MSP430f5438  using CCSv5.  I am writing software to reprogram the processor over a cell  modem.  So I have all the TCP connections done and can download the new load image. But I need to allocate a large chunk of RAM to hold the image while I do a CRC check and a block check. I need around 64k bytes... How do I manipulate the heap size to allocate this big of a chunk of memory?  When I just put the heap size to 15000 I get a linker error on fit.. I think that I need to allocate a additional RAM section for this I/O buffer...

anyone done something like this on a 5438?

 

Roger Knott

  • Roger,

    i don't think it is possible to do that. The MSP430F5438(A) has only 16 KB of SRAM. Maybe you need a bigger MCU like MSP430F5359 (66 KB SRAM) or from another family like the Tiva.

  • I am using the MSP430F5438 and from the TI document I should have 4 banks of 4KB RAM but as much as I would like to dynamically allocate I would accept a static allocation and use one of the 4 banks 64kb of main - code memory to declare a big array of characters. Is there a way to use main memory bank 1 - 3  for holding this data?

     

    my program load size is about 35kb ,with data about 4 1/2 kb...

  • It can't be as easy as just declaring a char buffer[64000]; ???  

     

    The linker would choke on that wouldn't it?

  • LEO: 

    thanks for your help..

    OK I just tried the to declare an array of characters    char buffer[65000];

    and then filled each with a number 0...65000 with a for loop..

    the compiler didn't choke but this won't execute....

    I put a breakpoint in the module and it is outside the {first FFFF} near memory ...

    the breakpoint is at f5dde which is in "LA LA  land"  in the map file the beginning of my function is

       0000af2c    0000013e     OTA.obj (.text:Perform_OTA)

    the length is to small to hold 65k bytes.?? what  has happened???  did it just mess up the link?

     

    Confused in Irving..

  • I just had an epiphany!!!!

    the architecture of the MSP430 is different from what I am accustomed to programming .... in the MSP430 there is high speed flash memory and ram memory...

    the processor executes out of flash .... main memory is flash not ram!! so block 3 main memory is 0x30000 up to 0x3ffff and its flash not ram.

     

    Now my problem becomes easier ... there is a erase / write flash driver library functions that will do the trick with less than a dozen lines of code.

     

    Sorry I was so clueless,  hope you had a good laugh.

     

  • Roger,

    how often do you need to download the new image? please keep in mind that flash memory has limited erase-write cycle, and the way to write flash memory is that you need to erase first then do the writing. (flash erase is basically setting all bit to 1, and flash writing is basically only possible from bit 1 -> 0).

  • I found a very helpful test program that instructed me in the driverlib functions. so using it is a slam dunk... however... During development the flash write count will be 100's to 1000's  but in the field 5 to 50 in a lifetime of the hardware. Unless the requirements change.. then all bets may be off!

     

    Thanks for your help..

**Attention** This is a public forum