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.

MSPM0C1104: how to configure flash sections

Part Number: MSPM0C1104
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

hi experts:

    I use CCS Theia 1.3.1 and want to save user data from start address 0x3c00, the data size is small and only need to be written a few times, so it isn't necessary to use the eeprom way, so I uncheck the link file generation in CCS Theia and move device_linker.cmd to the project path, change the flash length to 0x3c00 as below:

MEMORY
{
    FLASH           (RX)  : origin = 0x00000000, length = 0x00003C00
    SRAM            (RWX) : origin = 0x20000000, length = 0x00000400
    BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x00000080
}
if I rebuild the project, errors output:
[84]makefile:165: recipe for target 'R2_frunk_switch_sensor_test.out' failed
[85]"../device_linker.cmd", line 51: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".rodata" size 0x9b. Available memory ranges:
[86] FLASH size: 0x3c00 unused: 0x48 max hole: 0x48
[87]"../device_linker.cmd", line 49: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".cinit" size 0x53. Available memory ranges:
[88] FLASH size: 0x3c00 unused: 0x38 max hole: 0x38
[89]error #10010: errors encountered during linking; "R2_frunk_switch_sensor_test.out" not built
[90]tiarmclang: error: tiarmlnk command failed with exit code 1 (use -v to see invocation)
[91]gmake[1]: *** [R2_frunk_switch_sensor_test.out] Error 1
[92]gmake[1]: Target 'secondary-outputs' not remade because of errors.
[93]makefile:161: recipe for target 'all' failed
[94]gmake: *** [all] Error 2
[95]**** Build Finished ****
Then I change the optimization level from 2 to 0, and the errors gone, so I believe it is because the output bin exceed the 0x3c00, but actually in the map file the size is only 0x1e50 far away from 0x3c00, I don't know why?
Another issue is that If the user data at 0x3c00 is set, but next time after a new flashing, the data in 0x3c00 will be set to 0xff, can we limit the flash range to advoid this? Hopefully I can get help, thanks.
Bill
  • For the real code size, I think you can get the exact one after you fit the code into MCU. Can you expand the Flash range and double check whether it is 0x1e50.

    For your second question, please try this:

  • hi, Eason:

         I opened the wrong map file, it isn't 0x1e50 but 0x3bd8, still not exceed 0x3c00, regarding second question, I'd like to keep the user data from 0x3c00 after new flashing of FW, how to do that by using UniFlash?

    ******************************************************************************
    TI ARM Clang Linker PC v3.2.1
    ******************************************************************************
    >> Linked Fri Jul 19 16:30:11 2024

    OUTPUT FILE NAME: <R2_frunk_switch_sensor_test.out>
    ENTRY POINT SYMBOL: "_c_int00_noargs" address: 000031d5


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH 00000000 00003c00 00003bd8 00000028 R X
    SRAM 20000000 00000400 00000156 000002aa RW X
    BCR_CONFIG 41c00000 00000080 00000000 00000080 R


    SEGMENT ALLOCATION MAP