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.

[参考译文] TMS320F28034:使用 c2prog 和安全密码进行串行编程

Guru**** 2391175 points
Other Parts Discussed in Thread: TMS320F28034, UNIFLASH

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1276447/tms320f28034-serial-programming-with-c2prog-and-security-password

器件型号:TMS320F28034
主题中讨论的其他器件: UNIFLASH

大家好!

我有关于使用 C2prog 和安全密码进行串行编程的问题。

我有一个板带有微控制器 TMS320F28034。

使用 Uniflash 软件对微控制器进行编程并使用密码锁定了器件后、如果要在串行引导模式下使用 C2prog 对其重新编程、则必须在配置中插入正确的密码、如下图所示:

如果我选中"Smart Sector selection"复选框、C2prog 将擦除 FlashA 扇区和密码、因此将其重新编程后、微控制器不受密码保护。

为了保持原始密码、我选择擦除闪存 A 之外的所有闪存扇区。 但这样做时、我收到一个错误(见下图):

 

并且编程过程不会结束。 必须单击"取消"按钮。

微控制器似乎已正确编程。

我的问题是:

这是否是正确的继续方式?

谢谢。

马西莫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Massimo:

    在您提供给 C2Prog 的可执行文件中、是否也有内容映射到闪存 A 扇区?

    谢谢。此致、
    瓦姆西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Vamsi:

    感谢您的答复。

    我在*。cmd 文件下附上了该文件。 您可以看到、我更改了 FLASHA 的分配、因为我需要更多的内存(因此 闪存 A 成为了 FLASHH 和 FLASG 的组合)。 但在 FLASHA 的实际位置(从0X3F6000到0x3F7F80)理论上没有什么。

    C2prog 在存储器的地址0x3F7FF0处给了我一个错误、这是它存储的位置我认为"(CSM_RSVD   :origin = 0x3F7F80、length = 0x000076)"

    MEMORY
    {
    PAGE 0:    /* Program Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
       RAML0       : origin = 0x008000, length = 0x000800     /* on-chip RAM block L0 */
       RAML1       : origin = 0x008800, length = 0x000400     /* on-chip RAM block L1 */
       OTP         : origin = 0x3D7800, length = 0x000400     /* on-chip OTP */
       //FLASHH      : origin = 0x3E8000, length = 0x002000     /* on-chip FLASH */
       //FLASHG      : origin = 0x3EA000, length = 0x002000     /* on-chip FLASH */
       FLASHF      : origin = 0x3EC000, length = 0x002000     /* on-chip FLASH */
       FLASHE      : origin = 0x3EE000, length = 0x002000     /* on-chip FLASH */
       FLASHD      : origin = 0x3F0000, length = 0x002000     /* on-chip FLASH */
       FLASHC      : origin = 0x3F2000, length = 0x002000     /* on-chip FLASH */
       //FLASHA      : origin = 0x3F6000, length = 0x001F80     /* on-chip FLASH */
       FLASHA      : origin = 0x3E8000, length = 0x004000     /* on-chip FLASH */
       CSM_RSVD    : origin = 0x3F7F80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
       BEGIN       : origin = 0x3F7FF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */
       CSM_PWL_P0  : origin = 0x3F7FF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
    
       IQTABLES    : origin = 0x3FE000, length = 0x000B50     /* IQ Math Tables in Boot ROM */
       IQTABLES2   : origin = 0x3FEB50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
       IQTABLES3   : origin = 0x3FEBDC, length = 0x0000AA	  /* IQ Math Tables in Boot ROM */
    
       ROM         : origin = 0x3FF27C, length = 0x000D44     /* Boot ROM */
       RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
       VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */
    
    PAGE 1 :   /* Data Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
               /* Registers remain on PAGE1                                                  */
    
       BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
       RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
       RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
       RAML2       : origin = 0x008C00, length = 0x000400     /* on-chip RAM block L2 */
       RAML3       : origin = 0x009000, length = 0x001000     /* on-chip RAM block L3 */
       FLASHB      : origin = 0x3F4000, length = 0x002000     /* on-chip FLASH */
    
    }
    
    /* Allocate sections to memory blocks.
       Note:
             codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
                       execution when booting to flash
             ramfuncs  user defined section to store functions that will be copied from Flash into RAM
    */
    
    SECTIONS
    {
    
       /* Allocate program areas: */
       .cinit              : > FLASHA      PAGE = 0
       .pinit              : > FLASHA,     PAGE = 0
       .text               : > FLASHA      PAGE = 0
       codestart           : > BEGIN       PAGE = 0
       ramfuncs            : LOAD = FLASHD,
                             RUN = RAML0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             RUN_START(_RamfuncsRunStart),
                             PAGE = 0
    
       csmpasswds          : > CSM_PWL_P0  PAGE = 0
       csm_rsvd            : > CSM_RSVD    PAGE = 0
    
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM0       PAGE = 1
       //.ebss               : > RAML2       PAGE = 1
       //.esysmem            : > RAML2       PAGE = 1
       .ebss               : > RAML3       PAGE = 1
       .esysmem            : > RAML3       PAGE = 1
    
       /* Initalized sections go in Flash */
       /* For SDFlash to program these, they must be allocated to page 0 */
       .econst             : > FLASHA      PAGE = 0
       .switch             : > FLASHA      PAGE = 0
    
       /* Allocate IQ math areas: */
       IQmath              : > FLASHA      PAGE = 0            /* Math Code */
       IQmathTables        : > IQTABLES,   PAGE = 0, TYPE = NOLOAD
    
      /* Uncomment the section below if calling the IQNexp() or IQexp()
          functions from the IQMath.lib library in order to utilize the
          relevant IQ Math table in Boot ROM (This saves space and Boot ROM
          is 1 wait-state). If this section is not uncommented, IQmathTables2
          will be loaded into other memory (SARAM, Flash, etc.) and will take
          up space, but 0 wait-state is possible.
       */
       /*
       IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
       {
    
                  IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)
    
       }
       */
        /* Uncomment the section below if calling the IQNasin() or IQasin()
           functions from the IQMath.lib library in order to utilize the
           relevant IQ Math table in Boot ROM (This saves space and Boot ROM
           is 1 wait-state). If this section is not uncommented, IQmathTables2
           will be loaded into other memory (SARAM, Flash, etc.) and will take
           up space, but 0 wait-state is possible.
        */
        /*
        IQmathTables3    : > IQTABLES3, PAGE = 0, TYPE = NOLOAD
        {
    
                   IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)
    
        }
        */
    
       /* .reset is a standard section used by the compiler.  It contains the */
       /* the address of the start of _c_int00 for C Code.   /*
       /* When using the boot ROM this section and the CPU vector */
       /* table is not needed.  Thus the default type is set here to  */
       /* DSECT  */
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT
       vectors             : > VECTORS     PAGE = 0, TYPE = DSECT
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */

     

    此致、

    马西莫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Massimo,

    在链接器命令文件中有  csmpasswds :> csm_PWL_p0 page = 0。

    这意味着它也会尝试重新编程密码。

    谢谢。此致、

    瓦姆西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Vamsi、

    抱歉、我想我对链接器文件还有一些了解。 因此、为了解决此问题、我按以下方式更改了密码行(添加了 DSECT):

    csmpasswds:>csm_PWL_p0 page = 0、type = DSECT
    csm_rsvd :> csm_rsvd page = 0, type = dsect

    在 C2prog 中、我需要始终取消选中"Smart Sector selection"框并 擦除闪存 A 以外的所有闪存扇区。

    以这种方式一切都很好。

    这是真的吗?

    谢谢。此致、

    马西莫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Massimo:

    如果记住正确、智能扇区选择会根据输入闪存映像文件中的地址自动选择必须擦除的扇区。

    如果您想避免因任何原因擦除给定扇区、即使闪存映像中有一些内容映射到该扇区、则需要取消选中该框。

    我可以返回并确认。

    谢谢。此致、
    瓦姆西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Vamsi:

    谢谢! 如果您可以确认它会有所帮助。

    如果可能的话、我只需清除密码扇区即可。

    如果我在重新编程前不擦除闪存 A 的其余部分、是否会出现问题?

    此致、

    马西莫。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Massimo,

    我给出的功能说明是正确的。

    但是、您需要专注于映射到同一扇区(a)的其他内容、而您不打算擦除这些内容。   您可以检查映射文件以查看其它哪些段被映射到该扇区-并确保这不会是问题。  例如、在闪存入口点、会有一个分支用于 codestart。  如果 codestart 被映射至一个与你之前可执行文件不同的位置、那么如果你没有在扇区 A 中更新它、那么控件将分支至一个不正确的位置。

    为什么不同时对密码重新编程?

    谢谢。此致、

    瓦姆西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Massimo:  

    由于我没有收到您的回复、因此我将关闭此帖子、前提是我的最后一次回复帮助您解决了此问题。

    如果您仍有其他问题、可以根据需要打开新帖子。

    谢谢。此致、

    瓦姆西