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.

DCSM on F28375D and SYS/BIOS

Hi.

I have a system with F28375D device running SYS/BIOS. The system runs from Flash, using:

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

on CPU1 and

memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,	(uint32_t)&Cla1funcsLoadSize);

to load the CLA1 code to RAM.

I've configured the DCSM module, programmed the password and I can lock and unlock the memory successfully. Once I select the Flash and RAM regions on GRABSECT and GRABRAM registers, the device won't boot again in Standalone mode.

I have 2 similar boards with the same firmware. One with 0x00000B5A on the BOOTCTRL register, and the other one with the BOOTCTRL register not programmed (I user the TRST, GPIO72 and GPIO84 to select the boot mode).

None of the board boots after the GRABSECT and GRABRAM programming.

All the memory is allocated to Z1 on DCSM and none is configured as EXEONLY.

What am I missing?

Best regards,

Hugo Cunha.

  • Hi Hugo,

    Where does RamfuncsRunStart and RamfuncsLoadStart points to? If any of these points to secure region then it'll not work unless you place the memcpy functions into secure region. It's because only code running from secure region can read/write to secure memories (both from same zone so in this case Z1).

    Regards,

    Vivek Singh

  • Hi Vivek.

    All the Flash and RAM sectors belong to the Z1 block, so there shouldn't be any problem writing from Flash to RAM.

    Parts of my linker files:

        /* CLA specific sections */
       Cla1Prog         : LOAD = FLASHA | FLASHB | FLASHC | FLASHD | FLASHE |
                                 FLASHF | FLASHG | FLASHH | FLASHI | FLASHJ |
                                 FLASHK | FLASHL | FLASHM | FLASHN PAGE = 0,
                          RUN = LS2_RAM PAGE = 1,
                          LOAD_START(_Cla1funcsLoadStart),
                          LOAD_END(_Cla1funcsLoadEnd),
                          RUN_START(_Cla1funcsRunStart),
                          LOAD_SIZE(_Cla1funcsLoadSize),
                          ALIGN(4)

       /* CLA C compiler sections */
       //
       // Must be allocated to memory the CLA has write access to
       //
       CLAscratch       :
                         { *.obj(CLAscratch)
                         . += CLA_SCRATCHPAD_SIZE;
                         *.obj(CLAscratch_end) } >  LS1_RAM,  PAGE = 1
    
       .scratchpad      : > LS1_RAM,       PAGE = 1
       .bss_cla		    : > LS1_RAM,       PAGE = 1
       .const_cla	    :  LOAD = FLASHB,
                           RUN = LS1_RAM,
                           RUN_START(_Cla1ConstRunStart),
                           LOAD_START(_Cla1ConstLoadStart),
                           LOAD_SIZE(_Cla1ConstLoadSize),
                           PAGE = 1

    For ramfuncs:

        codestart           : > BEGIN   PAGE = 0
        ramfuncs            : LOAD = FLASHA | FLASHB | FLASHC | FLASHD | FLASHE |
                                     FLASHF | FLASHG | FLASHH | FLASHI | FLASHJ |
                                     FLASHK | FLASHL | FLASHM | FLASHN PAGE = 0
                              RUN  = LS05SARAM  PAGE = 1
                              LOAD_START(_RamfuncsLoadStart),
                              LOAD_SIZE(_RamfuncsLoadSize),
                              LOAD_END(_RamfuncsLoadEnd),
                              RUN_START(_RamfuncsRunStart),
                              RUN_SIZE(_RamfuncsRunSize),
                              RUN_END(_RamfuncsRunEnd)
    
    #ifdef __TI_COMPILER_VERSION
    #if __TI_COMPILER_VERSION >= 15009000
        .TI.ramfunc : {} LOAD = FLASHA | FLASHB | FLASHC | FLASHD | FLASHE |
                                FLASHF | FLASHG | FLASHH | FLASHI | FLASHJ |
                                FLASHK | FLASHL | FLASHM | FLASHN PAGE = 0,
                         RUN  = LS05SARAM PAGE = 1,
                         table(BINIT)
    #endif
    #endif

    Best regards,

    Hugo Cunha. 

  • Please see map file to check where memcpy function is mapped ?

    Regards,

    Vivek Singh

  • Hi Vivek.

    I can load new out files without changing the Zone Select Block, as long as I unlock the memory with the password, correct?

    Here's part of the map file: 

    ******************************************************************************
                 TMS320C2000 Linker PC v6.4.11                     
    ******************************************************************************
    >> Linked Wed Oct 05 14:57:56 2016
    
    OUTPUT FILE NAME:   <DC-AC-F28375D-cpu1.out>
    ENTRY POINT SYMBOL: "_c_int00"  address: 0008c376
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      D01SARAM              0000b000   00001000  00000027  00000fd9  RWIX
      DCSM_Z1               0005f000   00000030  00000024  0000000c  RWIX
      DCSM_Z2               0005f040   00000030  00000024  0000000c  RWIX
      DCSM_COMMON           0005f070   00000010  00000008  00000008  RWIX
      DCSM_Z1_OTP           00078000   00000020  00000020  00000000  RWIX
      DCSM_Z2_OTP           00078200   00000020  00000020  00000000  RWIX
      BEGIN                 00080000   00000002  00000002  00000000  RWIX
      FLASHA                00080002   00001ffe  0000153e  00000ac0  RWIX
      FLASHB                00082000   00002000  00000000  00002000  RWIX
      FLASHC                00084000   00002000  00000000  00002000  RWIX
      FLASHD                00086000   00002000  00000000  00002000  RWIX
      FLASHE                00088000   00008000  00005eaa  00002156  RWIX
      FLASHF                00090000   00008000  00000000  00008000  RWIX
      FLASHG                00098000   00008000  00000000  00008000  RWIX
      FLASHH                000a0000   00008000  00000000  00008000  RWIX
      FLASHI                000a8000   00008000  00000000  00008000  RWIX
      FLASHJ                000b0000   00008000  00000000  00008000  RWIX
      FLASHK                000b8000   00002000  00000000  00002000  RWIX
      FLASHL                000ba000   00002000  00000000  00002000  RWIX
      FLASHM                000bc000   00002000  00000000  00002000  RWIX
      FLASHN                000be000   00002000  00000000  00002000  RWIX
      RESET                 003fffc0   00000002  00000000  00000002  RWIX
    
    PAGE 1:
      BOOT_RSVD             00000002   00000120  00000000  00000120  RWIX
      M01SARAM              00000122   000006de  000006bf  0000001f  RWIX
      ADCA_RESULT           00000b00   00000020  00000018  00000008  RWIX
      ADCB_RESULT           00000b20   00000020  00000018  00000008  RWIX
      ADCC_RESULT           00000b40   00000020  00000018  00000008  RWIX
      ADCD_RESULT           00000b60   00000020  00000018  00000008  RWIX
      CPU_TIMER0            00000c00   00000008  00000008  00000000  RWIX
      CPU_TIMER1            00000c08   00000008  00000008  00000000  RWIX
      CPU_TIMER2            00000c10   00000008  00000008  00000000  RWIX
      PIE_CTRL              00000ce0   00000020  0000001a  00000006  RWIX
      PIE_VECT              00000d00   00000200  00000000  00000200  RWIX
      DMA                   00001000   00000200  000000e0  00000120  RWIX
      CLA1                  00001400   00000040  0000003e  00000002  RWIX
      CLA1_MSGRAMLOW        00001480   00000080  00000036  0000004a  RWIX
      CLA1_MSGRAMHIGH       00001500   00000080  00000016  0000006a  RWIX
      EPWM1                 00004000   00000100  00000100  00000000  RWIX
      EPWM2                 00004100   00000100  00000100  00000000  RWIX
      EPWM3                 00004200   00000100  00000100  00000000  RWIX
      EPWM4                 00004300   00000100  00000100  00000000  RWIX
      EPWM5                 00004400   00000100  00000100  00000000  RWIX
      EPWM6                 00004500   00000100  00000100  00000000  RWIX
      EPWM7                 00004600   00000100  00000100  00000000  RWIX
      EPWM8                 00004700   00000100  00000100  00000000  RWIX
      EPWM9                 00004800   00000100  00000100  00000000  RWIX
      EPWM10                00004900   00000100  00000100  00000000  RWIX
      EPWM11                00004a00   00000100  00000100  00000000  RWIX
      EPWM12                00004b00   00000100  00000100  00000000  RWIX
      ECAP1                 00005000   00000020  00000020  00000000  RWIX
      ECAP2                 00005020   00000020  00000020  00000000  RWIX
      ECAP3                 00005040   00000020  00000020  00000000  RWIX
      ECAP4                 00005060   00000020  00000020  00000000  RWIX
      ECAP5                 00005080   00000020  00000020  00000000  RWIX
      ECAP6                 000050a0   00000020  00000020  00000000  RWIX
      EQEP1                 00005100   00000040  00000022  0000001e  RWIX
      EQEP2                 00005140   00000040  00000022  0000001e  RWIX
      EQEP3                 00005180   00000040  00000022  0000001e  RWIX
      DACA                  00005c00   00000010  00000008  00000008  RWIX
      DACB                  00005c10   00000010  00000008  00000008  RWIX
      DACC                  00005c20   00000010  00000008  00000008  RWIX
      CMPSS1                00005c80   00000020  00000020  00000000  RWIX
      CMPSS2                00005ca0   00000020  00000020  00000000  RWIX
      CMPSS3                00005cc0   00000020  00000020  00000000  RWIX
      CMPSS4                00005ce0   00000020  00000020  00000000  RWIX
      CMPSS5                00005d00   00000020  00000020  00000000  RWIX
      CMPSS6                00005d20   00000020  00000020  00000000  RWIX
      CMPSS7                00005d40   00000020  00000020  00000000  RWIX
      CMPSS8                00005d60   00000020  00000020  00000000  RWIX
      SDFM1                 00005e00   00000080  00000080  00000000  RWIX
      SDFM2                 00005e80   00000080  00000080  00000000  RWIX
      MCBSPA                00006000   00000040  00000024  0000001c  RWIX
      MCBSPB                00006040   00000040  00000024  0000001c  RWIX
      SPIA                  00006100   00000010  00000010  00000000  RWIX
      SPIB                  00006110   00000010  00000010  00000000  RWIX
      ***                  00006120   00000010  00000010  00000000  RWIX
      SPID                  00006130   00000010  00000000  00000010  RWIX
      UPP                   00006200   00000100  00000048  000000b8  RWIX
      WD                    00007000   00000040  0000002b  00000015  RWIX
      NMIINTRUPT            00007060   00000010  00000007  00000009  RWIX
      XINT                  00007070   00000010  0000000b  00000005  RWIX
      SCIA                  00007200   00000010  00000010  00000000  RWIX
      SCIB                  00007210   00000010  00000010  00000000  RWIX
      SCIC                  00007220   00000010  00000010  00000000  RWIX
      SCID                  00007230   00000010  00000010  00000000  RWIX
      I2CA                  00007300   00000040  00000022  0000001e  RWIX
      I2CB                  00007340   00000040  00000022  0000001e  RWIX
      ADCA                  00007400   00000080  00000080  00000000  RWIX
      ADCB                  00007480   00000080  00000080  00000000  RWIX
      ADCC                  00007500   00000080  00000080  00000000  RWIX
      ADCD                  00007580   00000080  00000080  00000000  RWIX
      INPUT_XBAR            00007900   00000020  00000020  00000000  RWIX
      XBAR                  00007920   00000020  00000020  00000000  RWIX
      SYNC_SOC              00007940   00000010  00000006  0000000a  RWIX
      DMACLASRCSEL          00007980   00000040  0000001a  00000026  RWIX
      EPWM_XBAR             00007a00   00000040  00000040  00000000  RWIX
      CLB_XBAR              00007a40   00000040  00000000  00000040  RWIX
      OUTPUT_XBAR           00007a80   00000040  00000040  00000000  RWIX
      GPIOCTRL              00007c00   00000180  00000180  00000000  RWIX
      GPIODAT               00007f00   00000030  00000030  00000000  RWIX
      LS0_RAM               00008000   00000800  00000000  00000800  RWIX
      LS1_RAM               00008800   00000800  00000480  00000380  RWIX
      LS2_RAM               00009000   00000800  000006b6  0000014a  RWIX
      LS05SARAM             00009800   00001800  00001762  0000009e  RWIX
      RAMGS0                0000c000   00001000  00000c34  000003cc  RWIX
      RAMGS1                0000d000   00001000  00000000  00001000  RWIX
      RAMGS2                0000e000   00001000  00000000  00001000  RWIX
      RAMGS3                0000f000   00001000  00000000  00001000  RWIX
      RAMGS4                00010000   00001000  00000000  00001000  RWIX
      RAMGS5                00011000   00001000  00000000  00001000  RWIX
      RAMGS6                00012000   00001000  00000000  00001000  RWIX
      RAMGS7                00013000   00001000  00000000  00001000  RWIX
      RAMGS8                00014000   00001000  00000000  00001000  RWIX
      RAMGS9                00015000   00001000  00000000  00001000  RWIX
      RAMGS10               00016000   00001000  00000000  00001000  RWIX
      RAMGS11               00017000   00001000  00000000  00001000  RWIX
      RAMGS12               00018000   00001000  00000000  00001000  RWIX
      RAMGS13               00019000   00001000  00000000  00001000  RWIX
      RAMGS14               0001a000   00001000  00000000  00001000  RWIX
      RAMGS15               0001b000   00001000  00000000  00001000  RWIX
      CPU2TOCPU1RAM         0003f800   00000400  00000000  00000400  RWIX
      CPU1TOCPU2RAM         0003fc00   00000400  00000000  00000400  RWIX
      EMIF1                 00047000   00000800  00000070  00000790  RWIX
      EMIF2                 00047800   00000800  00000070  00000790  RWIX
      IPC                   00050000   00000024  00000024  00000000  RWIX
      FLASHPUMPSEMAPHORE    00050024   00000002  00000002  00000000  RWIX
      DEV_CFG               0005d000   00000180  0000012e  00000052  RWIX
      ANALOG_SUBSYS         0005d180   00000080  00000048  00000038  RWIX
      CLK_CFG               0005d200   00000100  00000032  000000ce  RWIX
      CPU_SYS               0005d300   00000100  00000082  0000007e  RWIX
      ROMPREFETCH           0005e608   00000002  00000002  00000000  RWIX
      MEMCFG                0005f400   00000080  00000080  00000000  RWIX
      EMIF1CONFIG           0005f480   00000020  00000020  00000000  RWIX
      EMIF2CONFIG           0005f4a0   00000020  00000020  00000000  RWIX
      ACCESSPROTECTION      0005f4c0   00000040  00000040  00000000  RWIX
      MEMORYERROR           0005f500   00000040  00000040  00000000  RWIX
      ROMWAITSTATE          0005f540   00000002  00000002  00000000  RWIX
      FLASH0_CTRL           0005f800   00000300  00000182  0000017e  RWIX
      FLASH0_ECC            0005fb00   00000040  00000028  00000018  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    
    (...)
    
    DcsmZ1RegsFile 
    *          0    0005f000    00000024     UNINITIALIZED
                      0005f000    00000024     F2837xD_GlobalVariableDefs.obj (DcsmZ1RegsFile)
    
    DcsmZ2RegsFile 
    *          0    0005f040    00000024     UNINITIALIZED
                      0005f040    00000024     F2837xD_GlobalVariableDefs.obj (DcsmZ2RegsFile)
    
    DcsmCommonRegsFile 
    *          0    0005f070    00000008     UNINITIALIZED
                      0005f070    00000008     F2837xD_GlobalVariableDefs.obj (DcsmCommonRegsFile)
    
    DcsmZ1OtpFile 
    *          0    00078000    00000020     NOLOAD SECTION
                      00078000    00000020     F2837xD_GlobalVariableDefs.obj (DcsmZ1OtpFile)
    
    DcsmZ2OtpFile 
    *          0    00078200    00000020     NOLOAD SECTION
                      00078200    00000020     F2837xD_GlobalVariableDefs.obj (DcsmZ2OtpFile)
    
    .ti_catalog_c2800_initF2837x_begin 
    *          0    00080000    00000002     
                      00080000    00000002     Boot.a28FP : Boot_asm.o28FP (.ti_catalog_c2800_initF2837x_begin)
    
    ramfuncs   0    000806ba    00000038     RUN ADDR = 0000a000
                      000806ba    00000034     F2837xD_SysCtrl.obj (ramfuncs:_InitFlash)
                      000806ee    00000004     F2837xD_usDelay.obj (ramfuncs)
    
    .text:ti_catalog_c2800_initF2837x_flashfuncs 
    *          0    000806f2    00000027     RUN ADDR = 0000b000
                      000806f2    00000027     Boot.a28FP : Boot.o28FP (.text:ti_catalog_c2800_initF2837x_flashfuncs:_ti_catalog_c2800_initF2837x_Boot_initFlash)
    
    .cinit     0    00080719    00000741     
                      00080719    00000664     app_p28FP.o28FP (.cinit)
                      00080d7d    0000003e     Cla.obj (.cinit)
                      00080dbb    0000003b     <whole-program> (.cinit)
                      00080df6    0000002e     Adc.obj (.cinit)
                      00080e24    0000001b     PfcController.obj (.cinit)
                      00080e3f    0000000a     rts2800_fpu32.lib : exit.obj (.cinit)
                      00080e49    00000005     BuckController.obj (.cinit)
                      00080e4e    00000005     <whole-program> (.cinit:__lock)
                      00080e53    00000005     <whole-program> (.cinit:__unlock)
                      00080e58    00000002     --HOLE-- [fill = 0]
    
    (...)
    
    .binit     0    00081538    0000000a     
                      00081538    0000000a     (.binit)
    
    (...)
    
    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
    
    page  address   name                                                      
    ----  -------   ----                                                      
    
    0     000806ba  _Cla1funcsLoadEnd                                         
    abs   000006b6  _Cla1funcsLoadSize                                        
    0     00080004  _Cla1funcsLoadStart                                       
    0     00009000  _Cla1funcsRunStart                                        
    
    (...)
    
    0     0000a000  _InitFlash                                                
    
    (...)
    
    0     000806f2  _RamfuncsLoadEnd                                          
    abs   00000038  _RamfuncsLoadSize                                         
    0     000806ba  _RamfuncsLoadStart                                        
    0     0000a038  _RamfuncsRunEnd                                           
    abs   00000038  _RamfuncsRunSize                                          
    0     0000a000  _RamfuncsRunStart                                         
    
    (...)
    
    1     0000a000  __STACK_END                                               
    abs   00000800  __STACK_SIZE                                              
    0     00081538  __TI_table_binit                                          
    0     00000084  ___ASM__                                                  
    0     00000000  ___ISA__                                                  
    0     00000037  ___PLAT__                                                 
    0     00000013  ___TARG__                                                 
    1     0000013a  ___TI_cleanup_ptr                                         
    1     0000013c  ___TI_dtors_ptr                                           
    0     0008b650  ___TI_readmsg                                             
    0     0008b5f8  ___TI_writemsg                                            
    0     0000005d  ___TRDR__                                                 
    0     00081538  ___binit__                                                
    abs   ffffffff  ___c_args__                                               
    0     00080719  ___cinit__                                                
    
    (...)
    
    0     0008ca20  _ti_catalog_c2800_initF2837x_Boot_configurePllDivs        
    0     0008d92f  _ti_catalog_c2800_initF2837x_Boot_defaultLimpAbortFunction
    0     0008dd81  _ti_catalog_c2800_initF2837x_Boot_disableWatchdog         
    0     00080000  _ti_catalog_c2800_initF2837x_Boot_entry                   
    0     0008dd27  _ti_catalog_c2800_initF2837x_Boot_init                    
    0     0000b000  _ti_catalog_c2800_initF2837x_Boot_initFlash               
    0     0008ddc1  _ti_catalog_c2800_initF2837x_Boot_initStartup             
    0     0008de48  _ti_catalog_c2800_initF2837x_Boot_limpAbort               
    
    (...)
    
    0     0000a000  _InitFlash                                                
    0     0000a000  _RamfuncsRunStart                                         
    0     0000a034  _F28x_usDelay                                             
    0     0000a038  _RamfuncsRunEnd                                           
    0     0000b000  _ti_catalog_c2800_initF2837x_Boot_initFlash               
    0     0005f000  _DcsmZ1Regs                                               
    0     0005f040  _DcsmZ2Regs                                               
    0     0005f070  _DcsmCommonRegs                                           
    0     00078000  _DcsmZ1Otp                                                
    0     00078200  _DcsmZ2Otp                                                
    0     00080000  _ti_catalog_c2800_initF2837x_Boot_entry                   
    0     00080004  _Cla1funcsLoadStart                                       
    0     000806ba  _Cla1funcsLoadEnd                                         
    0     000806ba  _RamfuncsLoadStart                                        
    0     000806f2  _RamfuncsLoadEnd                                          
    0     00080719  ___cinit__                                                
    0     00080719  cinit                                                     
    
    (...)
    
    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    page  address   name                                                      
    ----  -------   ----
    abs   00000000  _Cla1ConstLoadSize                                        
    abs   00000001  _xdc_runtime_Startup__EXECFXN__C                          
    abs   00000001  _xdc_runtime_Startup__RESETFXN__C                         
    abs   00000038  _RamfuncsLoadSize                                         
    abs   00000038  _RamfuncsRunSize                                          
    

    Best regards,

    Hugo Cunha.

  • Hi Hugo,

    I can load new out files without changing the Zone Select Block, as long as I unlock the memory with the password, correct?

    Yes, you can load the new files after unlocking the zone with password.

    Could you step though the code by unlocking the zone and see the address from where memcpy function is getting executed?

    Regards,

    Vivek Singh

  • Hi Hugo, Let us know if you have further queries on this.

  • Hi Vivek.

    I was able to solve the problem, but I forgot to post the solution here.

    The problem was that the boot code was being loaded to MRAMx, which can't be "grabbed" by any DCSM zone. But the device locks the access to MRAMx at boot time for security, so it was not able to boot from flash correctly because it wasn't able to load the functions to the assigned RAM section.

    Best regards,

    Hugo Cunha.

  • Thanks for the update.