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.

TMS320F280037C: DCSM 및 FLASH 영역 Read/Write 관련 질문

Part Number: TMS320F280037C


Hello!! champs

There is a part in my program that writes and erases data in the FLASH (0x83000) area.

If you set DCSM as follows,

An error occurs when data is written to and deleted from FLASH.

In this regard, the questions are as follows:

1. Is it impossible to read/write in the FLASH area when DCSM is set?

1-1. Is there a workaround if this is not possible?

Please answer.

We always appreciate your help.

  • Hi,

    When you secure any flash sector by assigning it to a zone, program and erase operation can not be performed to these secure flash sector unless -

    1. The zone is unlocked by using password match flow
    2. program/erase code is running from secure RAM assigned to same zone as of the secure flash sectors.

    Hope this is clear.

    You can refer this app note also which provides detail on similar topic.

    Regards,

    Vivek Singh

  • Thank you for answer.

    "program/erase code is running from secure RAM assigned to same zone as of the secure flash sectors."

    As for the above, if all FLASH/RAM is allocated to ZONE 1, does PROGRAM/ERASE work?

    Regards.

  • Yes, that will work.

    Regards,

    Vivek Singh

  • thank you for your answer

    All FLASH Sector/RAM is allocated to Zone2.

    CMD files are in RAMGS for bss, data, system, and const.

    Text is assigned to RAMLS.

    Maybe I did something wrong with the settings in the CMD file?

    The CMD file I set up is as follows.

    MEMORY
    {
       BEGIN           	: origin = 0x00080000, length = 0x00000002
       BOOT_RSVD		: origin = 0x00000002, length = 0x00000126
    
       BOOTROM          : origin = 0x003F8000, length = 0x00007FC0
       SECURE_ROM       : origin = 0x003F2000, length = 0x00006000
    
       RESET            : origin = 0x003FFFC0, length = 0x00000002
    
       RAMM0          	  : origin = 0x00000128, length = 0x000002D8	/* stack */
       RAMM1        	  : origin = 0x00000400, length = 0x00000380	/* on-chip RAM block M1 */
       BOOT_RSVD_SYSBIOS  : origin = 0x00000780, length = 0x00000080
      
       RAMLS0_1         : origin = 0x00008000, length = 0x00001000	  
       RAMLS2_7         : origin = 0x00009000, length = 0x00003000    
    
       RAMGS0_2         : origin = 0x0000C000, length = 0x00003000    
       RAMGS3           : origin = 0x0000F000, length = 0x00001000
    
       /* Flash sectors */
       /* BANK 0 */
       FLASHB0_BOOTLOADER_VER : origin = 0x080010, length = 0x000040  /* BANK0 on-chip Flash sector0 */
       FLASHB0_BOOTLOADER     : origin = 0x080050, length = 0x002EA0  /* BANK0 on-chip Flash sector0~2 */
       FLASHB0_APP_RESET_VEC  : origin = 0x083010, length = 0x000008  /* BANK0 on-chip Flash sector3 */
       FLASHB0_APP_SIGN       : origin = 0x083018, length = 0x000008  /* BANK0 on-chip Flash sector3 */
       FLASHB0_APP_VER        : origin = 0x083020, length = 0x000050  /* BANK0 on-chip Flash sector3 */
       FLASHB0_APP            : origin = 0x083070, length = 0x00AF90  /* BANK0 on-chip Flash sector3~13 */
       FLASHB0_APP_MTR_DATA   : origin = 0x08E000, length = 0x001000  /* BANK0 on-chip Flash sector14 */
       FLASHB0_APP_EEP_DATA   : origin = 0x08F000, length = 0x001000  /* BANK0 on-chip Flash sector15 */
    
    
       /* BANK 1 */
       FLASH_BANK1_SEC0  : origin = 0x090000, length = 0x001000
       FLASH_BANK1_SEC1  : origin = 0x091000, length = 0x001000
       FLASH_BANK1_SEC2  : origin = 0x092000, length = 0x001000
       FLASH_BANK1_SEC3  : origin = 0x093000, length = 0x001000
       FLASH_BANK1_SEC4  : origin = 0x094000, length = 0x001000
       FLASH_BANK1_SEC5  : origin = 0x095000, length = 0x001000
       FLASH_BANK1_SEC6  : origin = 0x096000, length = 0x001000
       FLASH_BANK1_SEC7  : origin = 0x097000, length = 0x001000
       FLASH_BANK1_SEC8  : origin = 0x098000, length = 0x001000
       FLASH_BANK1_SEC9  : origin = 0x099000, length = 0x001000
       FLASH_BANK1_SEC10 : origin = 0x09A000, length = 0x001000
       FLASH_BANK1_SEC11 : origin = 0x09B000, length = 0x001000
       FLASH_BANK1_SEC12 : origin = 0x09C000, length = 0x001000
       FLASH_BANK1_SEC13 : origin = 0x09D000, length = 0x001000
       FLASH_BANK1_SEC14 : origin = 0x09E000, length = 0x001000
       FLASH_BANK1_SEC15 : origin = 0x09F000, length = 0x001000
    }
    
    
    SECTIONS
    {
       codestart        : > BEGIN, ALIGN(8)
       .text            : > FLASHB0_BOOTLOADER,  ALIGN(8)
       .cinit           : > FLASHB0_BOOTLOADER,  ALIGN(8)
       .switch          : > FLASHB0_BOOTLOADER,  ALIGN(8)
       .reset           : > RESET,                  TYPE = DSECT /* not used, */
    
       .stack           : > RAMM0
    
       .init_array      : > FLASHB0_BOOTLOADER,  ALIGN(8)
       .bss             : > RAMGS0_2
       .bss:output      : > RAMGS0_2
       .bss:cio         : > RAMGS0_2
       .data            : > RAMGS0_2
       .sysmem          : > RAMGS0_2
       .const           : > FLASHB0_BOOTLOADER,  ALIGN(8)
    
       app_version 		: > FLASHB0_APP_VER
       app_sign 		: > FLASHB0_APP_SIGN
       boot_version     : > FLASHB0_BOOTLOADER_VER
       est_data			: > RAMGS0_2
    
       /*  Allocate IQ math areas: */
       IQmath           : > FLASHB0_BOOTLOADER,  ALIGN(8)
       IQmathTables     : > FLASHB0_BOOTLOADER,	 ALIGN(8)
    
       GROUP
       {
           .TI.ramfunc
           { -l FAPI_F28003x_EABI_v1.58.00.lib}
       } LOAD = FLASHB0_BOOTLOADER
       RUN = RAMLS2_7,
       LOAD_START(RamfuncsLoadStart),
       LOAD_SIZE(RamfuncsLoadSize),
       LOAD_END(RamfuncsLoadEnd),
       RUN_START(RamfuncsRunStart),
       RUN_SIZE(RamfuncsRunSize),
       RUN_END(RamfuncsRunEnd),
       ALIGN(8)
    
    }
    
    SECTIONS
    {
    	user_data 		      : > RAMM1
    	sys_data     	      : > RAMM1
    	ctrl_data		      : > RAMGS0_2
    	foc_data 		      : > RAMGS0_2
    	motor_data		      : > RAMGS0_2
    }
    
    SECTIONS
    {
       datalog_data	          : > RAMGS3
       graph_data		  	  : > RAMGS3
    }
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    what can i check ??

    regards.

  • I am not sure what issue you are facing and what is the flow of your operation. How are you trying to program the device ? Please provide more detail on what you are trying to achieve and what issue you are facing.

    Regards,

    Vivek Singh

  • There was insufficient information on the question.
    Sorry about that.

    The problems faced are as follows:

    1. What you want to implement
    - I want to prevent unwanted access to the FLASH/RAM area using DCSM.
    - I want to do READ/WRITE for the FLASH area during application operation with DCSM set.

    2. Progress
    - The following settings were made through DCSM.
    Both FLASH and RAM are allocated to ZONE2.
    Z2_GRABSECT1R = 0x55555555
    Z2_GRABSECT2R = 0x55555555
    Z2_GRABSECT3R = 0x55555555
    Z2_GRABRAM1R = 0x00005555

    PASSWORD was set by setting CSMKEY.


    - I modified the CMD file and set it as follows.
    assign text to RAMLS
    Assign bss , data, system, const to RAMGS

    3. Test results
    - Before setting up DCSM
    READ/WRITE is possible in the FLASH area during application operation.

    - After setting up DCSM
    READ/WRITE is not possible in FLASH area during application operation after Power On Reset.
    READ/WRITE is possible if you emulate and drive CSMPSWD during the Debug setting.
    (GPIO 24 Low, GPIO 32 High in wait mode)



    I want to make a program that reads/writes to the FLASH area with DCSM set.
    I checked the user guide you sent me earlier.
    It is explained that READ/WRITE is possible for RAM/FLASH allocated to the same zone.
    I thought it would be READ/WRITE in the FLASH area by allocating it to ZONE2,
    The test results did not.
    I'm not sure what I'm doing wrong, so I ask for wisdom.

    Regards.

  • Would it be ok re-explain the problem i'm facing??

    regards

  • Hi,

    READ/WRITE is not possible in FLASH area during application operation after Power On Reset.

    Once you set the security on, the READ/WRITE operation can be performed  by code running from same zone. One thing you need to check is you have done proper configuration of FLSEM register to change SEM bit field value to '10' so that Zone2 code can access flash control register. If his is not done then programming will not work.

    Regards,

    Vivek Singh

  • Hello

    This problem is solved. After setting up FLSEM, it works as desired.
    Regards