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.

Values for Ramfuncs

Other Parts Discussed in Thread: CONTROLSUITE

Where are the values for the Ramfuncs.. symbols set?

My map shows:

20000000 RamfuncsLoadEnd

00000000 RamfuncsLoadSize

20000000 RamfuncsLoadStart

20000000 RamfuncsRunEnd

00000000 RamfuncsRunSize

20000000 RamfuncsRunStart

My .cmd file data

GROUP

{

ramfuncs

{

-l F021_API_CortexM3_LE.lib

}

}

LOAD = FLASHLOAD,

RUN = C0_1,

LOAD_START(RamfuncsLoadStart),

LOAD_SIZE(RamfuncsLoadSize),

LOAD_END(RamfuncsLoadEnd),

RUN_START(RamfuncsRunStart),

RUN_SIZE(RamfuncsRunSize),

RUN_END(RamfuncsRunEnd),

PAGE = 0

In my code, I have this:

// The RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart

// symbols are created by the linker. Refer to the device .cmd file.

memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

What am I copying to where?

Thanks,

Pat

 

  • Pat,

    Something isn't right here....  The reason the addresses are the same is because the size for the Ramfuncs section is 0.  It would seem you aren't actually using any of the functions in this library therefore it isn't being linked in.

    I just built the new flash programming examples in the latest controlSUITE release and they generate correct addresses and sizes for these symbols in the map file.  Try using these examples and taking a look at how they work.

  • Trey,

    The example does work. Here is your .cmd

    /* Section allocation in memory */

    SECTIONS
    {
        .intvecs:   > INTVECS
        .resetisr:  > RESETISR
        .text   :   >> FLASH_N | FLASH_M
        .const  :   >> FLASH_N | FLASH_M
        .cinit  :   >  FLASH_N | FLASH_M
        .pinit  :   >  FLASH_N | FLASH_M

        .vtable :   >  C0 | C1 | C2 | C3
        .data   :   >  C2 | C3
        .bss    :   >> C2 | C3
        .sysmem :   >  C0 | C1 | C2 | C3
        .stack  :   >  C0 | C1 | C2 | C3
       
        .z1secvalues  :   >  CSM_ECSL_Z1
        .z1_csm_rsvd  :   >  CSM_RSVD_Z1
        .z2secvalues  :   >  CSM_ECSL_Z2
        .z2_csm_rsvd  :   >  CSM_RSVD_Z2
       
         GROUP
         {
           ramfuncs
           {
             -l F021_API_CortexM3_LE.lib
           }
         }                       LOAD = FLASH_N | FLASH_M,
                                 RUN = C0,
                                 LOAD_START(RamfuncsLoadStart),
                                 LOAD_SIZE(RamfuncsLoadSize),
                                 LOAD_END(RamfuncsLoadEnd),
                                 RUN_START(RamfuncsRunStart),
                                 RUN_SIZE(RamfuncsRunSize),
                                 RUN_END(RamfuncsRunEnd),
                                 PAGE = 0

    And here is your map:

    ramfuncs   0    00201200    000017fc     RUN ADDR = 20000000
                      00201200    000006c0     F021_API_CortexM3_LE.lib : Read.obj (.text)
                      002018c0    00000010     Fapi_UserDefinedFunctions.obj (.tramp.$.text:Fapi_serviceWatchdogTimer:Fapi_UserDefinedFunctions.obj$0x0.1)
                      002018d0    00000664     F021_API_CortexM3_LE.lib : FlashStateMachine.obj (.text)
                      00201f34    00000010     Fapi_UserDefinedFunctions.obj (.tramp.$.text:Fapi_setupEepromSectorEnable:Fapi_UserDefinedFunctions.obj$0x0.1)
                      00201f44    00000010     Fapi_UserDefinedFunctions.obj (.tramp.$.text:Fapi_setupBankSectorEnable:Fapi_UserDefinedFunctions.obj$0x0.1)
                      00201f54    0000033c     F021_API_CortexM3_LE.lib : Program.obj (.text)
                      00202290    0000020c                              : Info.obj (.text)
                      0020249c    00000184                              : Utilities.obj (.text)
                      00202620    00000120                              : BlankCheck.obj (.text)
                      00202740    000000a0                              : Init.obj (.text)
                      002027e0    0000009c                              : FlashStateMachine.obj (.text)
                      0020287c    00000064                              : Async.obj (.text)
                      002028e0    00000044                              : Verify.obj (.text)
                      00202924    00000010                              : Init.obj (.bss) [fill = 0]
                      00202934    000000bc     driverlib.lib : flash.obj (ramfuncs)
                      002029f0    0000000a     flash_programming_m3.obj (ramfuncs:Example_Error)
                      002029fa    00000002     flash_programming_m3.obj (ramfuncs:Example_Done)

    .text.1    0    002029fc    00001604    
                      002029fc    0000097c     driverlib.lib : sysctl.obj (.text)
                      00203378    000002b8                   : interrupt.obj (.text)
                      00203630    000002ac     flash_programming_m3.obj (.text:Example_CallFlashAPI)
                      002038dc    00000010     F021_API_CortexM3_LE.lib : Init.obj (.tramp.Fapi_initializeAPI.1)
                      002038ec    00000010     flash_programming_m3.obj (.tramp.$ramfuncs:Example_Error:flash_programming_m3.obj$0x0.1)
                      002038fc    00000010     F021_API_CortexM3_LE.lib : Info.obj (.tramp.Fapi_getLibraryInfo.1)
                      0020390c    00000010                              : FlashStateMachine.obj (.tramp.Fapi_setActiveFlashBank.1)
                      0020391c    00000010                              : Info.obj (.tramp.Fapi_getBankSectors.1)
                      0020392c    00000010                              : Async.obj (.tramp.Fapi_issueAsyncCommandWithAddress.1)
                      0020393c    00000010                              : FlashStateMachine.obj (.tramp.Fapi_checkFsmForReady.1)
                      0020394c    00000010                              : BlankCheck.obj (.tramp.Fapi_doBlankCheck.1)
                      0020395c    00000010                              : Program.obj (.tramp.Fapi_issueProgrammingCommand.1)
                      0020396c    00000010                              : FlashStateMachine.obj (.tramp.Fapi_getFsmStatus.1)
                      0020397c    00000010                              : Verify.obj (.tramp.Fapi_doVerifyByByte.1)
                      0020398c    00000010     flash_programming_m3.obj (.tramp.$ramfuncs:Example_Done:flash_programming_m3.obj$0x0.1)
                      0020399c    000002a0     driverlib.lib : dcsm.obj (.text)
                      00203c3c    00000180                   : ipc_util.obj (.text)
                      00203dbc    000000ac                   : watchdog.obj (.text)
                      00203e68    000000a8     Fapi_UserDefinedFunctions.obj (.text:Fapi_setupEepromSectorEnable)
                      00203f10    0000009c     rtsv7M3_T_le_eabi.lib : memcpy_t2.obj (.text)
                      00203fac    0000004c                           : cpy_tbl.obj (.text)
                      00203ff8    00000006     driverlib.lib : sysctl.obj (.text:SysCtlDelay)
                      00203ffe    00000002     startup_ccs.obj (.text:BusFaultISR)

    .text.2    0    00204000    00000344    
                      00204000    00000094     rtsv7M3_T_le_eabi.lib : auto_init.obj (.text)
                      00204094    00000078                           : memset_t2.obj (.text)
                      0020410c    00000068     flash_programming_m3.obj (.text:main)
                      00204174    00000010     driverlib.lib : flash.obj (.tramp.FlashInit.1)
                      00204184    00000048     rtsv7M3_T_le_eabi.lib : copy_decompress_rle.obj (.text:decompress:rle)
                      002041cc    00000044     Fapi_UserDefinedFunctions.obj (.text:Fapi_setupBankSectorEnable)
                      00204210    00000044     rtsv7M3_T_le_eabi.lib : exit.obj (.text)
                      00204254    00000036     driverlib.lib : cpu.obj (.text)
                      0020428a    00000002     startup_ccs.obj (.text:FaultISR)
                      0020428c    00000034     rtsv7M3_T_le_eabi.lib : boot.obj (.text)
                      002042c0    00000020     driverlib.lib : flash.obj (.text)
                      002042e0    00000020     rtsv7M3_T_le_eabi.lib : args_main.obj (.text)
                      00204300    00000018                           : _lock.obj (.text)
                      00204318    00000012                           : copy_decompress_none.obj (.text:decompress:none)
                      0020432a    00000010                           : copy_zero_init.obj (.text:decompress:ZI)
                      0020433a    00000004     Fapi_UserDefinedFunctions.obj (.text:Fapi_serviceWatchdogTimer)
                      0020433e    00000002     startup_ccs.obj (.text:IntDefaultHandler)
                      00204340    00000002     startup_ccs.obj (.text:NmiSR)
                      00204342    00000002     rtsv7M3_T_le_eabi.lib : tdeh_init.obj (.text)

     

    I deduce from this data that RamfuncsLoadStart is the start of the .text section as defined by LOAD = FLASH_N | FLASH_M; that RamfuncsLoadEnd is the end of the actual code consumed by the allocation of all the ramfuncs .obj files, and that RamfuncsLoadSize is this length. In a similar fashion, RamfuncsRunStart is defined as the beginning of the ram section C0; that RamfuncsRunEnd is the end of the memory space required (same as RamfuncsLoadEnd), and that it's size is the same as RamfuncsLoadSize. Therefore, the values associated with these are automatically assigned and / or calculated by the linker and I do not need / cannot set the size of the data to be transferred to ram.

    Are my assumptions correct?

    Thanks,

    Pat

     

  • All of your assumptions are 100% correct!

  • Trey,

    I found that by removing my debug folder in the project list and reinstalling it, I could get some of the ram code allocated.  The _c_int00 address seems quite high for some reason. Also I have lost the driverlib.lib , Example_Error, and Example_Done. Here is my new map:

    Any direction would be helpful, Thanks.

    OUTPUT FILE NAME:   <Concerto_cm3_tx.out>

    ENTRY POINT SYMBOL: "_c_int00"  address: 002108f9

     

     

    MEMORY CONFIGURATION

     

             name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

      CSM_ECSL_Z1           00200000   00000024  00000000  00000024  RWIX

      CSM_RSVD_Z1           00200024   0000000c  00000000  0000000c  RWIX

      RESETISR              00200030   0000000c  00000006  00000006  R  X

      INTVECS               00201000   000001b0  000001b0  00000000  R  X

      FLASHLOAD             00201200   00002e00  000018ea  00001516  R  X

      FLASH                 00204000   00030000  0000cf3a  000230c6  R  X

      FLASH_DLOAD           00240000   00030000  00000000  00030000  R  X

      CSM_RSVD_Z2           0027ff00   000000dc  00000000  000000dc  RWIX

      CSM_ECSL_Z2           0027ffdc   00000024  00000000  00000024  RWIX

      C0_1                  20000000   00004000  00001cbe  00002342  RW X

      BOOT_RSVD             20004000   00000ff8  00000000  00000ff8  R  X

      C2_3                  200051b0   00002e50  00002c14  0000023c  RW X

      S0                    20008000   00002000  00000000  00002000  RW X

      S1                    2000a000   00002000  00000000  00002000  RW X

      S2                    2000c000   00002000  00000000  00002000  RW X

      S3                    2000e000   00002000  00000000  00002000  RW X

      S4                    20010000   00002000  00000000  00002000  RW X

      S5                    20012000   00002000  00000000  00002000  RW X

      S6                    20014000   00002000  00000000  00002000  RW X

      S7                    20016000   00002000  00000000  00002000  RW X

      CTOMRAM               2007f000   00000800  00000000  00000800  R  X

      MTOCRAM               2007f800   00000800  00000000  00000800  RW X

     

     

    SEGMENT ALLOCATION MAP

     

    run origin  load origin   length   init length attrs members

    ----------  ----------- ---------- ----------- ----- -------

    00200030    00200030    00000006   00000006    r-x

      00200030    00200030    00000006   00000006    r-x .resetisr

    00201000    00201000    000001b0   000001b0    r--

      00201000    00201000    000001b0   000001b0    r-- .intvecs

    00204000    00204000    0000cf40   0000cf40    r-x

      00204000    00204000    0000cae2   0000cae2    r-x .text

      00210ae4    00210ae4    000003a8   000003a8    r-- .const

      00210e90    00210e90    000000b0   000000b0    r-- .cinit

    20000000    00201200    000018ea   000018ea    rwx

      20000000    00201200    000018ea   000018ea    rwx ramfuncs

    200018ec    200018ec    00000224   00000124    rw-

      200018ec    200018ec    00000124   00000124    rw- .data

      20001a10    20001a10    00000100   00000000    rw- .stack

    20001c00    20001c00    000001b0   00000000    rw-

      20001c00    20001c00    000001b0   00000000    rw- .vtable

    200051b0    200051b0    00002c14   00000000    rw-

      200051b0    200051b0    00002c14   00000000    rw- .bss

     

     

    SECTION ALLOCATION MAP

     

     output                                  attributes/

    section   page    origin      length       input sections

    --------  ----  ----------  ----------   ----------------

    .resetisr

    *          0    00200030    00000006    

                      00200030    00000006     startup_ccs.obj (.resetisr)

     

    .intvecs   0    00201000    000001b0    

                      00201000    000001b0     startup_ccs.obj (.intvecs)

     

    ramfuncs   0    00201200    000018ea     RUN ADDR = 20000000

                      00201200    000006c0     F021_API_CortexM3_LE.lib : Read.obj (.text)

                      002018c0    0000000a     Fapi_UserDefinedFunctions.obj (.tramp.Fapi_serviceWatchdogTimer.1)

                      002018ca    00000002     --HOLE-- [fill = 0]

                      002018cc    00000664     F021_API_CortexM3_LE.lib : FlashStateMachine.obj (.text)

                      00201f30    0000000a     Fapi_UserDefinedFunctions.obj (.tramp.Fapi_setupEepromSectorEnable.1)

                      00201f3a    00000002     --HOLE-- [fill = 0]

                      00201f3c    0000000a     Fapi_UserDefinedFunctions.obj (.tramp.Fapi_setupBankSectorEnable.1)

                      00201f46    00000002     --HOLE-- [fill = 0]

                      00201f48    0000033c     F021_API_CortexM3_LE.lib : Program.obj (.text)

                      00202284    0000020c                              : Info.obj (.text)

                      00202490    00000184                              : Utilities.obj (.text)

                      00202614    00000120                              : BlankCheck.obj (.text)

                      00202734    000000a0                              : Init.obj (.text)

                      002027d4    0000009c                              : FlashStateMachine.obj (.text)

                      00202870    00000064                              : Async.obj (.text)

                      002028d4    00000044                              : Verify.obj (.text)

                      00202918    00000010                              : Init.obj (.bss) [fill = 0]

                      00202928    00000108     flash.obj (ramfuncs)

                      00202a30    000000a4     CM3_IO.obj (ramfuncs)

                      00202ad4    0000000a     gpio.obj (.tramp.GPIOPinWrite.1)

                      00202ade    00000002     --HOLE-- [fill = 0]

                      00202ae0    0000000a     CM3_IO.obj (.tramp.FlashWrite.1)

     

    .text

     

     

    /* System memory map */

     

    MEMORY

    {

    CSM_ECSL_Z1 :

    CSM_RSVD_Z1 :

    RESETISR (RX) :

    INTVECS (RX) :

    FLASHLOAD (RX) :

    // FLASH (RX) :

    // seperate flash for Download file storage

    FLASH (RX) :

    FLASH_DLOAD (RX) :

    //

    CSM_RSVD_Z2 :

    CSM_ECSL_Z2 :

    //

    //C0 (RWX) :

    //C1 (RWX) :

    C0_1 (RWX) :

    BOOT_RSVD (RX) :

    //combine C2

    //C2 (RWX) :

    //C3 (RWX) :

    C2_3 (RWX) :

    S0 (RWX) :

    S1 (RWX) :

    S2 (RWX) :

    S3 (RWX) :

    S4 (RWX) :

    S5 (RWX) :

    S6 (RWX) :

    S7 (RWX) :

    CTOMRAM (RX) :

    MTOCRAM (RWX) :

    }

    /* Section allocation in memory */

    SECTIONS

    {

    {

    ramfuncs

    {

    -l F021_API_CortexM3_LE.lib

    }

    }

    LOAD_START(RamfuncsLoadStart),

    LOAD_SIZE(RamfuncsLoadSize),

    LOAD_END(RamfuncsLoadEnd),

    RUN_START(RamfuncsRunStart),

    RUN_SIZE(RamfuncsRunSize),

    RUN_END(RamfuncsRunEnd),

    PAGE = 0

    {

    PUTBUFFER

    PUTWRITEIDX

    GETREADIDX

    }

    {

    GETBUFFER :

    GETWRITEIDX :

    PUTREADIDX :

    }

    }

    __STACK_TOP = __stack + 256;

  • Pat,

    _c_int00 is in the right place.  That address is a flash address so that is fine.  Typically we also link in the codestart_branch file which is designed such that when it links it resides in the "Boot to flash" vector address.

    What do you mean by you lost driverlib?  Did you accidentally delete the lib file?  If so you can rebuild it by importing and building the driverlib project, just like you would with any other example.  I'm not sure about the other two functions you are missing.  Which example are you working with here?

  • Trey,

    I am trying to incorporate your latest flash_prog example code into my current application.

    What I meant is that the ramfuncs file flash.obj was not included in the map. I do have driverlib.lib included in both the projects list as well as a path to the dir location using the include options. It just doesn't get loaded. One difference is that I am using compiler 4.9.7 which is compatible with my application code vs v4.6.6 that you recommended. Could that be the problem? Is there a compromise?

    Thanks,

    Pat

     

  • I tried v4.9.7 for the flash example and it looks almost the same, at least it did include flash.obj and the two Example subroutines.

    ******************************************************************************

    TMS470 Linker PC v4.9.7

    ******************************************************************************

    >> Linked Wed May 08 10:51:07 2013

    OUTPUT FILE NAME: <flash_programming_m3.out>

    ENTRY POINT SYMBOL: "_c_int00" address: 002041f5

     

    MEMORY CONFIGURATION

    name origin length used unused attr fill

    ---------------------- -------- --------- -------- -------- ---- --------

    CSM_ECSL_Z1 00200000 00000024 00000024 00000000 RWIX

    CSM_RSVD_Z1 00200024 0000000c 0000000c 00000000 RWIX

    RESETISR 00200030 00000008 00000006 00000002 R X

    INTVECS 00201000 000001b0 000001b0 00000000 R X

    FLASH_N 00201200 00002e00 00002dfc 00000004 R X

    FLASH_M 00204000 00004000 000003b0 00003c50 R X

    FLASH_L 00208000 00004000 00000000 00004000 R X

    FLASH_K 0020c000 00004000 00000000 00004000 R X

    FLASH_J 00210000 00010000 00000000 00010000 R X

    FLASH_I 00220000 00010000 00000000 00010000 R X

    FLASH_H 00230000 00010000 00000000 00010000 R X

    FLASH_G 00240000 00010000 00000000 00010000 R X

    FLASH_F 00250000 00010000 00000000 00010000 R X

    FLASH_E 00260000 00010000 00000000 00010000 R X

    FLASH_D 00270000 00004000 00000000 00004000 R X

    FLASH_C 00274000 00004000 00000000 00004000 R X

    FLASH_B 00278000 00004000 00000000 00004000 R X

    FLASH_A 0027c000 00003f00 00000000 00003f00 R X

    CSM_RSVD_Z2 0027ff00 000000dc 0000000c 000000d0 RWIX

    CSM_ECSL_Z2 0027ffdc 00000024 00000024 00000000 RWIX

    C0 20000000 00002000 00001b48 000004b8 RW X

    C1 20002000 00002000 00000000 00002000 RW X

    BOOT_RSVD 20004000 00000900 00000000 00000900 R X

    C2 20004900 00001700 00000134 000015cc RW X

    C3 20006000 00002000 00000000 00002000 RW X

    S0 20008000 00002000 00000000 00002000 RW X

    S1 2000a000 00002000 00000000 00002000 RW X

    S2 2000c000 00002000 00000000 00002000 RW X

    S3 2000e000 00002000 00000000 00002000 RW X

    S4 20010000 00002000 00000000 00002000 RW X

    S5 20012000 00002000 00000000 00002000 RW X

    S6 20014000 00002000 00000000 00002000 RW X

    S7 20016000 00002000 00000000 00002000 RW X

    CTOMRAM 2007f000 00000800 00000000 00000800 R X

    MTOCRAM 2007f800 00000800 00000000 00000800 RW X

     

    SEGMENT ALLOCATION MAP

    run origin load origin length init length attrs members

    ---------- ----------- ---------- ----------- ----- -------

    00200000 00200000 00000036 00000036 r-x

    00200000 00200000 00000024 00000024 r-- .z1secvalues

    00200024 00200024 0000000c 0000000c r-- .z1_csm_rsvd

    00200030 00200030 00000006 00000006 r-x .resetisr

    00201000 00201000 000001b0 000001b0 r--

    00201000 00201000 000001b0 000001b0 r-- .intvecs

    002029f0 002029f0 000019c0 000019c0 r-x

    002029f0 002029f0 0000160c 0000160c r-x .text.1

    00204000 00204000 0000029c 0000029c r-x .text.2

    0020429c 0020429c 000000cc 000000cc r-- .const

    00204368 00204368 00000048 00000048 r-- .cinit

    0027ff00 0027ff00 0000000c 0000000c r--

    0027ff00 0027ff00 0000000c 0000000c r-- .z2_csm_rsvd

    0027ffdc 0027ffdc 00000024 00000024 r--

    0027ffdc 0027ffdc 00000024 00000024 r-- .z2secvalues

    20000000 00201200 000017f0 000017f0 rwx

    20000000 00201200 000017f0 000017f0 rwx ramfuncs

    20001800 20001800 00000358 00000000 rw-

    20001800 20001800 00000258 00000000 rw- .vtable

    20001a58 20001a58 00000100 00000000 rw- .stack

    20004900 20004900 00000100 00000000 rw-

    20004900 20004900 00000100 00000000 rw- .bss

    20004a00 20004a00 00000034 00000034 rw-

    20004a00 20004a00 00000034 00000034 rw- .data

     

    SECTION ALLOCATION MAP

    output attributes/

    section page origin length input sections

    -------- ---- ---------- ---------- ----------------

    .z1secvalues

    * 0 00200000 00000024

    00200000 00000024 dcsm_z1_secvalues.obj (.z1secvalues)

    .z1_csm_rsvd

    * 0 00200024 0000000c

    00200024 0000000c dcsm_z1_secvalues.obj (.z1_csm_rsvd)

    .resetisr

    * 0 00200030 00000006

    00200030 00000006 startup_ccs.obj (.resetisr)

    .intvecs 0 00201000 000001b0

    00201000 000001b0 startup_ccs.obj (.intvecs)

    ramfuncs 0 00201200 000017f0 RUN ADDR = 20000000

    00201200 000006c0 F021_API_CortexM3_LE.lib : Read.obj (.text)

    002018c0 0000000a Fapi_UserDefinedFunctions.obj (.tramp.Fapi_serviceWatchdogTimer.1)

    002018ca 00000002 --HOLE-- [fill = 0]

    002018cc 00000664 F021_API_CortexM3_LE.lib : FlashStateMachine.obj (.text)

    00201f30 0000000a Fapi_UserDefinedFunctions.obj (.tramp.Fapi_setupEepromSectorEnable.1)

    00201f3a 00000002 --HOLE-- [fill = 0]

    00201f3c 0000000a Fapi_UserDefinedFunctions.obj (.tramp.Fapi_setupBankSectorEnable.1)

    00201f46 00000002 --HOLE-- [fill = 0]

    00201f48 0000033c F021_API_CortexM3_LE.lib : Program.obj (.text)

    00202284 0000020c : Info.obj (.text)

    00202490 00000184 : Utilities.obj (.text)

    00202614 00000120 : BlankCheck.obj (.text)

    00202734 000000a0 : Init.obj (.text)

    002027d4 0000009c : FlashStateMachine.obj (.text)

    00202870 00000064 : Async.obj (.text)

    002028d4 00000044 : Verify.obj (.text)

    00202918 00000010 : Init.obj (.bss) [fill = 0]

    00202928 000000bc driverlib.lib : flash.obj (ramfuncs)

    002029e4 0000000c flash_programming_m3.obj (ramfuncs)

    .text.1 0 002029f0 0000160c

    002029f0 0000097c driverlib.lib : sysctl.obj (.text)

    0020336c 00000314 flash_programming_m3.obj (.text)

    00203680 0000000a F021_API_CortexM3_LE.lib : Init.obj (.tramp.Fapi_initializeAPI.1)

    0020368a 00000002 --HOLE-- [fill = 0]

    0020368c 0000000a flash_programming_m3.obj (.tramp.Example_Error.1)

    00203696 00000002 --HOLE-- [fill = 0]

    00203698 0000000a F021_API_CortexM3_LE.lib : Info.obj (.tramp.Fapi_getLibraryInfo.1)

    002036a2 00000002 --HOLE-- [fill = 0]

    002036a4 0000000a : FlashStateMachine.obj (.tramp.Fapi_setActiveFlashBank.1)

    002036ae 00000002 --HOLE-- [fill = 0]

    002036b0 0000000a : Info.obj (.tramp.Fapi_getBankSectors.1)

    002036ba 00000002 --HOLE-- [fill = 0]

    002036bc 0000000a : Async.obj (.tramp.Fapi_issueAsyncCommandWithAddress.1)

    002036c6 00000002 --HOLE-- [fill = 0]

    002036c8 0000000a : FlashStateMachine.obj (.tramp.Fapi_checkFsmForReady.1)

    002036d2 00000002 --HOLE-- [fill = 0]

    002036d4 0000000a : BlankCheck.obj (.tramp.Fapi_doBlankCheck.1)

    002036de 00000002 --HOLE-- [fill = 0]

    002036e0 0000000a : Program.obj (.tramp.Fapi_issueProgrammingCommand.1)

    002036ea 00000002 --HOLE-- [fill = 0]

    002036ec 0000000a : FlashStateMachine.obj (.tramp.Fapi_getFsmStatus.1)

    002036f6 00000002 --HOLE-- [fill = 0]

    002036f8 0000000a : Verify.obj (.tramp.Fapi_doVerifyByByte.1)

    00203702 00000002 --HOLE-- [fill = 0]

    00203704 0000000a flash_programming_m3.obj (.tramp.Example_Done.1)

    0020370e 00000002 --HOLE-- [fill = 0]

    00203710 0000000a driverlib.lib : flash.obj (.tramp.FlashInit.1)

    0020371a 00000002 --HOLE-- [fill = 0]

    0020371c 000002b8 : interrupt.obj (.text)

    002039d4 000002a0 : dcsm.obj (.text)

    00203c74 00000180 : ipc_util.obj (.text)

    00203df4 000000ec Fapi_UserDefinedFunctions.obj (.text)

    00203ee0 000000ac driverlib.lib : watchdog.obj (.text)

    00203f8c 0000005e rtsv7M3_T_le_eabi.lib : copy_decompress_rle.obj (.text)

    00203fea 00000012 : copy_zero_init.obj (.text:decompress:ZI)

    .text.2 0 00204000 0000029c

    00204000 0000009c rtsv7M3_T_le_eabi.lib : memcpy_t2.obj (.text)

    0020409c 00000094 : auto_init.obj (.text)

    00204130 00000048 : cpy_tbl.obj (.text)

    00204178 00000044 : exit.obj (.text)

    002041bc 00000036 driverlib.lib : cpu.obj (.text)

    002041f2 00000002 --HOLE-- [fill = 0]

    002041f4 00000034 rtsv7M3_T_le_eabi.lib : boot.obj (.text)

    00204228 00000020 driverlib.lib : flash.obj (.text)

    00204248 00000018 rtsv7M3_T_le_eabi.lib : _lock.obj (.text)

    00204260 00000018 : args_main.obj (.text)

    00204278 0000000e : copy_decompress_none.obj (.text:decompress:none)

    00204286 00000008 startup_ccs.obj (.text)

    0020428e 00000002 --HOLE-- [fill = 0]

    00204290 00000006 driverlib.lib : sysctl.obj (.text:SysCtlDelay)

    00204296 00000006 rtsv7M3_T_le_eabi.lib : copy_decompress_rle.obj (.text:decompress:rle24)

    .const 0 0020429c 000000cc

    0020429c 00000064 driverlib.lib : sysctl.obj (.const)

    00204300 00000048 : interrupt.obj (.const:g_pulRegs)

    00204348 00000020 : interrupt.obj (.const)

    .cinit 0 00204368 00000048

    00204368 00000013 (.cinit..data.load) [load image, compression = rle]

    0020437b 00000001 --HOLE-- [fill = 0]

    0020437c 0000000c (__TI_handler_table)

    00204388 00000008 (.cinit..bss.load) [load image, compression = zero_init]

    00204390 00000008 (.cinit..vtable.load) [load image, compression = zero_init]

    00204398 00000018 (__TI_cinit_table)

    .z2_csm_rsvd

    * 0 0027ff00 0000000c

    0027ff00 0000000c dcsm_z2_secvalues.obj (.z2_csm_rsvd)

    .z2secvalues

    * 0 0027ffdc 00000024

    0027ffdc 00000024 dcsm_z2_secvalues.obj (.z2secvalues)

    .vtable 0 20001800 00000258 UNINITIALIZED

    20001800 00000258 driverlib.lib : interrupt.obj (.vtable)

    .stack 0 20001a58 00000100 UNINITIALIZED

    20001a58 00000100 --HOLE--

    .bss 0 20004900 00000100 UNINITIALIZED

    20004900 00000100 flash_programming_m3.obj (.bss:Buffer)

    .data 0 20004a00 00000034

    20004a00 00000020 flash_programming_m3.obj (.data)

    20004a20 00000008 rtsv7M3_T_le_eabi.lib : _lock.obj (.data)

    20004a28 00000008 : exit.obj (.data)

    20004a30 00000004 : stkdepth_vars.obj (.data)

    GETBUFFER

    * 0 2007f000 00000000 DSECT

    GETWRITEIDX

    * 0 2007f000 00000000 DSECT

    PUTREADIDX

    * 0 2007f000 00000000 DSECT

     

  • Pat,

    The compiler version shouldn't cause any trouble.

    The linker is only going to pull in what it needs.  From your map file it looks like it is pulling in the parts of driverlib that the project needs.

    Is there something specific that is wrong when you run the application or are you just trying to understand the whole compile/link process?

  • I have moved the example code into my application and am trying to duplicate the test there. The code hangs up at the point Fapi_GetBankSectors. If I comment out that code, it passes thru the code OK.

    ???

    Pat

     

  • Excellent, now we are getting somewhere.

    Are you calling FlashGainPump() before calling any of the Fapi functions?

    When you say it hangs, what do you mean?  Do we hit an ITRAP instruction? Does the CCS window go blank only showing an address in the debug window?

  • Yes, I call FlashGainPump() before entering this code: I get a FaultISR when it hangs. The Example_Error and Example_Done functions have been commented out so they return, but when I enable the Error function, the code never seems to get there.

     

     

    // write block of data to flash, given start add and no. bytes, return status

    Fapi_StatusType FlashWrite(uint32* LoadStart, uint32 LoadCount)

    {

    // uint8 pucProgTest[0x100];

    unsigned int i;

    uint32 u32Index = 0;

    uint8 Buffer[BYTES_IN_FLASH_BUFFER];

    Fapi_StatusType oReturnCheck;

    // Fapi_FlashStatusWordType oBlankStatus;

    Fapi_LibraryInfoType oLibInfo;

    Fapi_FlashStatusType oFlashStatus;

    Fapi_FlashBankSectorsType oFlashBankSectors;

    Fapi_FlashStatusWordType oFlashStatusWord;

    // for(i=0 ; i<0x100; i++)

    // pucProgTest[i] = i;

    // Disable ECC

    // *(unsigned int*)(0x4300) = 0;

    oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 75);

    if(oReturnCheck != Fapi_Status_Success)

    {

    //Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    // Fapi_getLibraryInfo function can be used to get the information

    // specific to the compiled version of the API library

    oLibInfo = Fapi_getLibraryInfo();

    // Fapi_setActiveFlashBank function sets the Flash bank and FMC

    // for further Flash operations to be performed on the bank

    oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);

    if(oReturnCheck != Fapi_Status_Success)

    {

    // Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    // Fapi_getBankSectors function returns the bank starting address,

    // number of sectors, sector sizes, and bank technology type

    // Above information is returned in a structure oFlashBankSectors of type

    // Fapi_FlashBankSectorsType

    oReturnCheck = Fapi_getBankSectors(Fapi_FlashBank0,&oFlashBankSectors);

    if(oReturnCheck != Fapi_Status_Success)

    {

    // Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (uint32 *)DLoad_Sector_Start);

    while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

    // Verify that Sector L is erased. The Erase step itself does a verify

    // as it goes. This verify is a 2nd verification that can be done.

    oReturnCheck = Fapi_doBlankCheck((uint32 *)DLoad_Sector_Start,

    Load_Sector_Length,

    &oFlashStatusWord);

    if(oReturnCheck != Fapi_Status_Success)

    {

    //Check Flash API documentation for possible errors

    //If Erase command fails, use Fapi_getFsmStatus() function to get

    // the FMSTAT register contents

    //to see if any of the EV bit, ESUSP bit, CSTAT bit or VOLTSTAT

    //bit is set (Refer to API documentation for more details)

    Example_Error(oReturnCheck);

    }

    // A data buffer of max 16 bytes can be supplied to the program function.

    // Each word is programmed until the whole buffer is programmed or a

    // problem is found.

    // However to program more a buffer that has more than 16 bytes,

    // program function can be called in a loop to program 16 bytes for each loop

    // iteration until the whole buffer is programmed

    // In this case just fill a buffer with data to program into the flash.

    for(i=0;i<=BYTES_IN_FLASH_BUFFER;i++)

    {

    Buffer[i] = i;

    }

     

    for(i=0, u32Index = DLoad_Sector_Start;

    (u32Index < (DLoad_Sector_Start + BYTES_IN_FLASH_BUFFER))

    && (oReturnCheck == Fapi_Status_Success); i+= 16, u32Index+= 16)

    {

    oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,Buffer+i,

    16,

    0,

    0,

    Fapi_AutoEccGeneration);

    while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

    if(oReturnCheck != Fapi_Status_Success)

    {

    // Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    // Read FMSTAT register contents to know the status of FSM after

    // program command for any debug

    oFlashStatus = Fapi_getFsmStatus();

    // Verify the values programmed. The Program step itself does a verify

    // as it goes. This verify is a 2nd verification that can be done.

    oReturnCheck = Fapi_doVerifyByByte((uint8 *)u32Index,

    16,

    Buffer+i,

    &oFlashStatusWord);

    if(oReturnCheck != Fapi_Status_Success)

    {

    // Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    }

    // Example: Program 0xFF bytes in Flash Sector DLoad + 0x20000 with out ECC

    // Disable ECC so that error is not generated when reading Flash

    // contents without ECC

    HWREG(FLASH_ERROR_BASE + FLASHERR_O_ECC_ENABLE) = 0x0;

    for(i=0, u32Index = DLoad_Sector_Start_ECC;

    (u32Index < (DLoad_Sector_Start_ECC + BYTES_IN_FLASH_BUFFER))

    && (oReturnCheck == Fapi_Status_Success); i+= 16, u32Index+= 16)

    {

    oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,

    Buffer+i,

    16,

    0,

    0,

    Fapi_DataOnly);

    while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

    if(oReturnCheck != Fapi_Status_Success)

    {

    //Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    //Read FMSTAT register contents to know the status of FSM after

    // program command for any debug

    oFlashStatus = Fapi_getFsmStatus();

    // Verify the values programmed. The Program step itself does a verify

    // as it goes. This verify is a 2nd verification that can be done.

    oReturnCheck = Fapi_doVerifyByByte((uint8 *)u32Index,

    16,

    Buffer+i,

    &oFlashStatusWord);

    if(oReturnCheck != Fapi_Status_Success)

    {

    //Check Flash API documentation for possible errors

    Example_Error(oReturnCheck);

    }

    }

    // end here, dont erase sectors again

    // Enable ECC

    HWREG(FLASH_ERROR_BASE + FLASHERR_O_ECC_ENABLE) = 0xA;

    // Leave control over pump

    FlashLeavePump();

    // Example is done here

    Example_Done();

    // COM_TX("FAPI example done",17);

    // COM_TX((UINT8*)&oFlashStatus,4);

    // COM_TX((UINT8*)&oLibInfo,4);

    return oReturnCheck;

    }

  • The code will run all the way through the programming function, but then seems to get lost somewhere. Here is some data from the watch window, followed by the .cmd file. Perhaps I need to segment all my flash sectors into 16k blocks like the 2 sectors that were set in the example???.  I would appreciate some direction here.

     

    oReturnCheck = Fapi_Error_Fail
    oLibInfo = {...}
     u8ApiMajorVersion = .
     u8ApiMinorVersion = 4
     u8ApiRevision = .
     oApiProductionStatus = Production
     u32ApiBuildNumber = 220
     u8ApiTechnologyType = .
     u8ApiTechnologyRevision = .
     u8ApiEndianness = .
     u32ApiCompilerVersion = 4009006
    oFlashBankSectors.u32NumberOfSectors = 14
    oFlashBankSectors.u32BankStartAddress = 2097152
    oFlashBankSectors.au8SectorSizes = 0x20007D3C
     [0] = .
     [1] = .
    oFlashStatus = 0

     

    /*

    //###########################################################################

    // FILE: F28M35H52C1_m3.cmd

    // TITLE: Linker Command File for F28M35H52C1 examples that run out of RAM

    // This ONLY includes all SARAM blocks on the F28M35H52C1 device.

    // This does not include flash or OTP.

    // Keep in mind that C0 and C1 are protected by the code

    // security module.

    // What this means is in most cases you will want to move to

    // another memory map file which has more memory defined.

    //###########################################################################

    // $TI Release: F28M35x Driver Library vBeta1 $

    // $Release Date: August 31, 2011 $

    //###########################################################################

    */

    --retain=g_pfnVectors

    /* The following command line options are set as part of the CCS project. */

    /* If you are building using the command line, or for some reason want to */

    /* define them here, you can uncomment and modify these lines as needed. */

    /* If you are using CCS for building, it is probably better to make any such */

    /* modifications in your CCS project and leave this file alone. */

    /* */

    /* --heap_size=0 */

    /* --stack_size=256 */

    /* --library=rtsv7M3_T_le_eabi.lib */

     

    /* The following options allow the user to program Z1 and Z2 DCSM security */

    /* values, include CSM PSWD, ECSL PSWD, GRABSECT, GRABRAM, and FLASH EXEONLY */

    /* The driverlib/dcsm_z1_secvalues.s and driverlib/dcsm_z2_secvalues.s files */

    /* must be included in the Flash project for the below 2 lines to take */

    /* effect. */

    --retain=dcsm_z1_secvalues.obj(

    .z1secvalues,.z1_csm_rsvd)

    --retain=dcsm_z2_secvalues.obj(

    .z2secvalues,.z2_csm_rsvd)

    /* System memory map */

     

    MEMORY

    {

    CSM_ECSL_Z1 :

    origin = 0x00200000, length = 0x0024

    CSM_RSVD_Z1 :

    origin = 0x00200024, length = 0x000C

    RESETISR (RX) :

    origin = 0x00200030, length = 0x000C /* Reset ISR is mapped to boot to Flash location */

    INTVECS (RX) :

    origin = 0x00201000, length = 0x01B0

    FLASHLOAD (RX) :

    origin = 0x00201200, length = 0x2E00 /* For storing code in Flash to copy to RAM at runtime */

    // FLASH (RX) :

    origin = 0x00204000, length = 0x7BFD0

    // seperate flash for Download file storage

    FLASH (RX) :

    origin = 0x00204000, length = 0x30000 //seperate section for NID, plus download boot stuff

    FLASH_DLOAD (RX) :

    origin = 0x00240000, length = 0x30000

    //

    CSM_RSVD_Z2 :

    origin = 0x0027FF00, length = 0x00DC /////

    CSM_ECSL_Z2 :

    origin = 0x0027FFDC, length = 0x0024

    //

    R.Liang: combine C0 and C1 into one memory C0_1

    //C0 (RWX) :

    origin = 0x20000000, length = 0x2000

    //C1 (RWX) :

    origin = 0x20002000, length = 0x2000

    C0_1 (RWX) :

    origin = 0x20000000, length = 0x4000

    BOOT_RSVD (RX) :

    origin = 0x20004000, length = 0x0FF8

    //combine C2

    and C3 into single memory C2_3

    //C2 (RWX) :

    origin = 0x200051B0, length = 0x0E50

    //C3 (RWX) :

    origin = 0x20006000, length = 0x2000

    C2_3 (RWX) :

    origin = 0x200051B0, length = 0x2E50 /////

    S0 (RWX) :

    origin = 0x20008000, length = 0x2000

    S1 (RWX) :

    origin = 0x2000A000, length = 0x2000

    S2 (RWX) :

    origin = 0x2000C000, length = 0x2000

    S3 (RWX) :

    origin = 0x2000E000, length = 0x2000

    S4 (RWX) :

    origin = 0x20010000, length = 0x2000

    S5 (RWX) :

    origin = 0x20012000, length = 0x2000

    S6 (RWX) :

    origin = 0x20014000, length = 0x2000

    S7 (RWX) :

    origin = 0x20016000, length = 0x2000

    CTOMRAM (RX) :

    origin = 0x2007F000, length = 0x0800

    MTOCRAM (RWX) :

    origin = 0x2007F800, length = 0x0800

    }

    /* Section allocation in memory */

    SECTIONS

    {

    .intvecs: > INTVECS

    .resetisr: > RESETISR

    .text : > FLASH

    .const : > FLASH

    .cinit : > FLASH

    .pinit : > FLASH

    .dload : > FLASH_DLOAD

    .vtable : > C0_1

    .data : > C0_1

    .bss : > C2_3

    .sysmem : > C0_1

    .stack : > C0_1

    .z1secvalues : > CSM_ECSL_Z1

    .z1_csm_rsvd : > CSM_RSVD_Z1

    .z2secvalues : > CSM_ECSL_Z2

    .z2_csm_rsvd : > CSM_RSVD_Z2

    GROUP

    {

    ramfuncs

    {

    -l F021_API_CortexM3_LE.lib

    }

    }

    LOAD = FLASHLOAD,

    RUN = C0_1,

    LOAD_START(RamfuncsLoadStart),

    LOAD_SIZE(RamfuncsLoadSize),

    LOAD_END(RamfuncsLoadEnd),

    RUN_START(RamfuncsRunStart),

    RUN_SIZE(RamfuncsRunSize),

    RUN_END(RamfuncsRunEnd),

    PAGE = 0

    GROUP : > MTOCRAM

    {

    PUTBUFFER

    PUTWRITEIDX

    GETREADIDX

    }

    GROUP : > CTOMRAM

    {

    GETBUFFER :

    TYPE = DSECT

    GETWRITEIDX :

    TYPE = DSECT

    PUTREADIDX :

    TYPE = DSECT

    }

    }

    __STACK_TOP = __stack + 256;

     

     

  • Pat,

    You might be getting an ECC error.  Could you try running your application with ECC disabled?

    FlashInit function can be modified to disable ECC.  See below code snippet from this function.

            //At reset, ECC is enabled

           HWREG(FLASH_ERROR_BASE + FLASHERR_O_ECC_ENABLE) = 0xA;

    In above code statement, instead of writing 0xA, write 0x0 to disable ECC as below:

           HWREG(FLASH_ERROR_BASE + FLASHERR_O_ECC_ENABLE) = 0x0;

    Thanks and regards,

    Vamsi

  • Vamsi,

    That didn't make any difference. I also re sectored my flash to more correspond with the example as such:

    Still doesn't work. I'm just clutching at straws here in order to find something that works.

    The PLC example that I started with used "FlashPump()". I commented this out, but is there some conflict here?

    Thanks,

    Pat

     

    /* System memory map */

     

    MEMORY

    {

    CSM_ECSL_Z1 :

    origin = 0x00200000, length = 0x0024

    CSM_RSVD_Z1 :

    origin = 0x00200024, length = 0x000C

    RESETISR (RX) :

    origin = 0x00200030, length = 0x000C /* Reset ISR is mapped to boot to Flash location */

    INTVECS (RX) :

    origin = 0x00201000, length = 0x01B0

    FLASHLOAD (RX) :

    origin = 0x00201200, length = 0x2E00 /* For storing code in Flash to copy to RAM at runtime */

    // FLASH (RX) :

    origin = 0x00204000, length = 0x7BFD0

    // seperate flash for Download file storage

    FLASH_M (RX) :

    origin = 0x00204000, length = 0x4000

    FLASH_L (RX) :

    origin = 0x00208000, length = 0x4000

    FLASH_K (RX) :

    origin = 0x0020C000, length = 0x4000

    FLASH_J (RX) :

    origin = 0x00210000, length = 0x10000

    FLASH_I (RX) :

    origin = 0x00220000, length = 0x10000

    FLASH_H (RX) :

    origin = 0x00230000, length = 0x10000

    FLASH_G (RX) :

    origin = 0x00240000, length = 0x10000

    FLASH_F (RX) :

    origin = 0x00250000, length = 0x10000

    FLASH_E (RX) :

    origin = 0x00260000, length = 0x10000

    FLASH_D (RX) :

    origin = 0x00270000, length = 0x4000

    FLASH_C (RX) :

    origin = 0x00274000, length = 0x4000

    FLASH_B (RX) :

    origin = 0x00278000, length = 0x4000

    FLASH_A (RX) :

    origin = 0x0027C000, length = 0x3F00

     

    // FLASH (RX) :

    origin = 0x00204000, length = 0x30000 //seperate section for NID, plus download boot stuff

    // FLASH_DLOAD (RX) :

    origin = 0x00240000, length = 0x30000

    //

    CSM_RSVD_Z2 :

    origin = 0x0027FF00, length = 0x00DC /////

    CSM_ECSL_Z2 :

    origin = 0x0027FFDC, length = 0x0024

    //

    R.Liang: combine C0 and C1 into one memory C0_1

    //C0 (RWX) :

    origin = 0x20000000, length = 0x2000

    //C1 (RWX) :

    origin = 0x20002000, length = 0x2000

    C0_1 (RWX) :

    origin = 0x20000000, length = 0x4000

    BOOT_RSVD (RX) :

    origin = 0x20004000, length = 0x0FF8

    //combine C2

    and C3 into single memory C2_3

    //C2 (RWX) :

    origin = 0x200051B0, length = 0x0E50

    //C3 (RWX) :

    origin = 0x20006000, length = 0x2000

    C2_3 (RWX) :

    origin = 0x200051B0, length = 0x2E50 /////

    S0 (RWX) :

    origin = 0x20008000, length = 0x2000

    S1 (RWX) :

    origin = 0x2000A000, length = 0x2000

    S2 (RWX) :

    origin = 0x2000C000, length = 0x2000

    S3 (RWX) :

    origin = 0x2000E000, length = 0x2000

    S4 (RWX) :

    origin = 0x20010000, length = 0x2000

    S5 (RWX) :

    origin = 0x20012000, length = 0x2000

    S6 (RWX) :

    origin = 0x20014000, length = 0x2000

    S7 (RWX) :

    origin = 0x20016000, length = 0x2000

    CTOMRAM (RX) :

    origin = 0x2007F000, length = 0x0800

    MTOCRAM (RWX) :

    origin = 0x2007F800, length = 0x0800

    }

    /* Section allocation in memory */

    SECTIONS

    {

    .intvecs: > INTVECS

    .resetisr: > RESETISR

    .text : > FLASH_M |FLASH_L | FLASH_K | FLASH_J | FLASH_I | FLASH_H

    .const : > FLASH_M |FLASH_L | FLASH_K | FLASH_J | FLASH_I | FLASH_H

    .cinit : > FLASH_M |FLASH_L | FLASH_K | FLASH_J | FLASH_I | FLASH_H

    .pinit : > FLASH_M |FLASH_L | FLASH_K | FLASH_J | FLASH_I | FLASH_H

    .dload : > FLASH_G | FLASH_F |FLASH_E | FLASH_D | FLASH_C | FLASH_B | FLASH_A

    .vtable : > C0_1

    .data : > C0_1

    .bss : > C2_3

    .sysmem : > C0_1

    .stack : > C0_1

    .z1secvalues : > CSM_ECSL_Z1

    .z1_csm_rsvd : > CSM_RSVD_Z1

    .z2secvalues : > CSM_ECSL_Z2

    .z2_csm_rsvd : > CSM_RSVD_Z2

    GROUP

    {

    ramfuncs

    {

    -l F021_API_CortexM3_LE.lib

    }

    }

    LOAD = FLASHLOAD,

    RUN = C0_1,

    LOAD_START(RamfuncsLoadStart),

    LOAD_SIZE(RamfuncsLoadSize),

    LOAD_END(RamfuncsLoadEnd),

    RUN_START(RamfuncsRunStart),

    RUN_SIZE(RamfuncsRunSize),

    RUN_END(RamfuncsRunEnd),

    PAGE = 0

    GROUP : > MTOCRAM

    {

    PUTBUFFER

    PUTWRITEIDX

    GETREADIDX

    }

    GROUP : > CTOMRAM

    {

    GETBUFFER :

    TYPE = DSECT

    GETWRITEIDX :

    TYPE = DSECT

    PUTREADIDX :

    TYPE = DSECT

    }

    }

    __STACK_TOP = __stack + 256;

     

  • oFlashBankSectors.au8SectorSizes (14) all are set to zero apparently, according to the Watch data when I break following Fapi_getBankSectors. Is there some reason why this value is not the value set in the .cmd file?

    Pat

     

  • OK, I think I found part of the problem. In your example flash_program, you disable hardware protection and never reenable it.  In my application, I disable hardware protection in order to setup the sys clock, then reenable it. Doing this causes the flash programming to fail. Removing the reenable allows it to work, but my app fails when I am configuring my GPIO. What's the proper procedure?

    Thanks,

    Pat

     

  • My PLC app uses the following flash pump code:

    // set up flash pump

    void

    FlashPump(void)

    {

    #define

    IPC_MPUMPREQUEST_KEY 0xA5937EC0

    // Key Value

    HWREG(MTOCIPC_BASE + IPC_O_MPUMPREQUEST) = IPC_MPUMPREQUEST_KEY | 0x2;

    }

    I cannot find any reference to FlashGainPump in the latest Flash API. What does FlashGainPump do? This may be part of my problem. Any help, please?

    Thanks,

    Pat

     

  • Pat,

    I just got the flash API in my concerto project to work. I adapted the example delivered with the flash API library.

    The C28x and the M3 share one flash pump so they have to claim this ressource to protect for each other. Figure 5-78 in the TechnicalReferenceManual (spruh22c) shows it quite clearely. A description how to deal with this semaphore is found in the TRM section 1.12.7 of the TRM.

    The simple functions FlashGainPump() and FlashLeavePump() are part of the MWare/driverlib of ControlSuite.
    Before Gaining the pump I have added a check whether this semaphore is available so my application can return with an error. It looks like this

    #pragma CODE_SECTION(IsFlashPumpIdle,"ramfuncs");
    /*******************************************************************************
    * \fn static BOOL IsFlashPumpIdle(void)                                         
    ********************************************************************************/
    /*!\param     -                                                                 
    *                                                                               
    *  \remarks   Checks if FlashPump Semaphore is available         
    *                                                                               
    *  \retval    success                                                    
    ********************************************************************************/
    static BOOL IsFlashPumpIdle(void)
    {
      return HWREG(MTOCIPC_BASE + IPC_O_MPUMPREQUEST) == 0;
    }

    FLASHARM_RC_T AppFlashArm_foo(void)
    {
      ...
      if (!IsFlashPumpIdle())
      { // Semaphore is not available
        return FLASHARM_RC_APP_PUMP_BUSY;
      }

      FlashGainPump(); // Gain flash pump semaphore
      ....

    Hope this helps,
    Stefan

  • Thanks for your reply, Stefan.

    As it turned out, I was able to get it to work by taking care of the initialization for all my other tasks before trying to write to flash. I had been trying to perform a test flash write before I had completed inititalization and beginning my task scheduler. Once I moved the flash write to a later time, I was successful. I preceded the flash write with FlashGainPump and followed it with FlashReleasePump. I cannot explain why this change worked, only that it did and, for now, I am satisfied.

    Thanks for the offer of help, though.

    Pat