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.

CCS/MSP432P401R: How to Flash programming using input file

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi. I did Flash programming using MSP432P401R example.

And now, I'm trying to move char array[ ] from SRAM to Flash.

1. array[ ] is in input.h file, so i included the header file in main.c where i wrote Flash programming code.

But there is an error that "array" is undefined....

Should i always define the array[ ] input data in main.c where i did Flash programming??

2. In Flash programming, Only use Flash Bank1, sector 31.

Sometimes, i want to move bigger data than Flash size....

How can i do?? 

Could i use another Flash sector? 

thanks.

  • Hello,

    yeonjoon Han said:
    1. array[ ] is in input.h file, so i included the header file in main.c where i wrote Flash programming code.

      Please add the const keyword to your variable (please do not declare it in your header file) , for example:

    const int array[] = {0,1,2,3,4,5,6,7,8,9};

    Global objects qualified as const are placed in the .const section. The linker allocates the .const section from ROM or FLASH.

    yeonjoon Han said:
    2. In Flash programming, Only use Flash Bank1, sector 31.

    The flash main memory on MSP432P401x MCUs can be up to 256KB. Flash main memory consists of up to 64 sectors of 4KB each, with a minimum erase granularity of 4KB (1 sector). The main memory can be viewed as two independent identical banks of up to 128KB each, allowing simultaneous read or execute from one bank while the other bank is undergoing a program or erase operation.

    yeonjoon Han said:
    Sometimes, i want to move bigger data than Flash size....

    Bigger than 4KB? or Bigger than 128KB? Could you please be more specific?

      Thanks,

        David

  • thank you for your help. And there are few questions.

    1. The data is Bigger than 4KB.

    the data size is almost 32KB... i mean that Can i erase other sectors on my way?

    I think that there are some important data In flash main memory, so i can't erase them.

    2. Can i do flash programming in another function, not in main function?

    I want to move "int matrix[50][50]" which is defined at int calculation(int a, int b ){ ... } to flash.

    So i wrote flash programming code in calculation function, but it's not working.... :(

  • Hello,

    yeonjoon Han said:
    the data size is almost 32KB... i mean that Can i erase other sectors on my way?

    Sure, just make sure to allocate enough memory on your linker file, because you do not want to overwrite your other sectors. Please take a look at this example to give you an idea on memory organization

    http://dev.ti.com/tirex/content/simplelink_msp432_sdk_bluetooth_plugin_1_20_00_42/examples/rtos/MSP_EXP432P401R/bluetooth/oad_firmware_update/README.html

    Also, please make sure you erase the flash before programming it.

    yeonjoon Han said:
    2. Can i do flash programming in another function, not in main function?

    Yes you can. The OAD example that I just made reference comes with a boot loader, so you could use it as reference. Also I  just want to confirm that you are aware of this flash_program_memory example

    Hopefully this helps.

      David

**Attention** This is a public forum