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.

F28335 Flash memory size

We use custom linker for our application. Please see the memory segmentation details below

MEMORY
{
PAGE 0: /* Program Memory */

BEGIN_M0 : origin = 0x000000, length = 0x000002 /* Part of M0 - used for "Boot to M0" bootloader mode. */
RAML_PROG : origin = 0x008000, length = 0x003000 /* on-chip RAM block L0 - L2. CSM Secure */
FLASHGH : origin = 0x300000, length = 0x010000 /* on-chip FLASH */
FLASHDEF : origin = 0x310000, length = 0x018000 /* on-chip FLASH */
FLASHBC : origin = 0x328000, length = 0x010000 /* on-chip FLASH */
FLASHA : origin = 0x338000, length = 0x007F80 /* on-chip FLASH */
CSM_RSVD : origin = 0x33FF80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
BEGIN : origin = 0x33FFF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
CSM_PWL : origin = 0x33FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */
OTP : origin = 0x380400, length = 0x000400 /* on-chip OTP */
ADC_CAL : origin = 0x380080, length = 0x000009 /* ADC_cal function in Reserved memory */
IQTABLES : origin = 0x3FE000, length = 0x000b50 /* IQ Math Tables in Boot ROM */
IQTABLES2 : origin = 0x3FEB50, length = 0x00008c /* IQ Math Tables in Boot ROM */
FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 /* FPU Tables in Boot ROM */
BOOTROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */

The problem is our latest software needs slightly more Flash memory than we assigned in linker (FLASHDEF length =  0x018000). Can I use some memory from FLASHBC and increase FLASHDEF size? Or it is fixed by hardware?

  • Yes, you can arbitrarily increase/decrease the sizes of the definitions in the linker file for programming purposes.  The ones you have shown above have already been combined in a sense, each Flash Sector(there are 8 on this device) are 0x8000 words long, so BC is spanning 2 sectors and DEF is spanning 3 sectors. 

    You can choose to split a sector depending on how much memory you are short, for instance you could add 0x4000 words to DEF and subtract 0x4000 words from BC, etc

     The only caveat I will give is that if you intend on erasing the flash, that has to fall on the defined sector boundaries in the DS.  This is why in the cmd file you've attached all the combinations still end on a 0x8000 word boundary. 

    Let's say you add the 0x4000 as I have shown above.  If you need to erase the 1st 0x4000 words of sector C(as part of BC), you have to erase the whole sector, which now means you have to erase the 0x4000 that is part of DEF now.

    This may not be an issue, depending on the function of BC or DEF, but I wanted to make sure we keep in mind that restriction.

    Let me know if you have further questions.

    Best,

    Matthew

  • Thanks for the help. It resolved our problem. For getting more memory for future use, I added C segment to code memory