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.

Linker error while using DSP2802x_CSMPasswords.asm

Other Parts Discussed in Thread: CONTROLSUITE, UNIFLASH

Hi All,

I have a small program to toggle LEDs in C2000 launch pad. It works fine. But when I try to include DSP2802x_CSMPasswords.asm I get the following error.

"../F28027.cmd", line 127: error #10099-D: program will not fit into available
   memory.  placement with alignment/blocking fails for section "csm_rsvd" size
   0xec page 0.  Available memory ranges:
   CSM_RSVD     size: 0x76         unused: 0x76         max hole: 0x76      
"../F28027.cmd", line 126: error #10099-D: program will not fit into available
   memory.  placement with alignment/blocking fails for section "csmpasswds"
   size 0x10 page 0.  Available memory ranges:
   CSM_PWL_P0   size: 0x8          unused: 0x8          max hole: 0x8

I'm using F28027.cmd, DSP2802x_Headers_nonBIOS.cmd, driverlib among other files. I did not make any changes to the cmd files. Just used from the controlSuite. Sections related to CSM are as follows:

   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 */

   csmpasswds          : > CSM_PWL_P0   PAGE = 0
   csm_rsvd            : > CSM_RSVD     PAGE = 0

Please let me know what I'm missing here. I've attached the whole project as a zip file.

Thanks,

Prakash

  • Parakash,

    I think you forgot to attach your project.  But it looks to me like you somehow have two password files included in your project because the linker is showing the csm_rsvd and csmpasswds sections to be exactly twice the size that they are supposed to be.  The csmpasswds section is length 0x10, but it should be 0x08.  Similarly, csm_rsvd section is length 0xec, and it should be 0x76.

    Regards,

    David

  • David, I had attached the project. Thanks!

    4606.toggle.zip

  • Prakash,

    I built your project and got the same errors.  Since the error is that a couple of specific sections would not fit, I modified the linker .cmd file to link these sections to a large flash memory area so the build would complete successfully.  I then examined the .map file to see what was contributing to these sections.  Linker .map file shows:

    csm_rsvd   0    003f0000    000000ec    
                      003f0000    00000076     DSP2802x_CSMPasswords.obj (csm_rsvd)
                      003f0076    00000076     driverlib.lib : F2802x_asmfuncs.obj (csm_rsvd)

    csmpasswds
    *          0    003f00ec    00000010    
                      003f00ec    00000008     DSP2802x_CSMPasswords.obj (csmpasswds)
                      003f00f4    00000008     driverlib.lib : F2802x_asmfuncs.obj (csmpasswds)

    So evidentally, there are sections called csm_rsvd and csmpasswds in the driver library.  I can see the source code for this in the controlSUITE\device_support\f2802x\v210\f2802x_common\source\F2802x_asmfuncs.asm.  Why these functions are in the library (especially the csmpasswds) I do not know.  The passwords in particular are something the user needs to set.  Having it in the library is useless.  This object module may have been included in the libray build by mistake.  It also seems odd that the sections would get pulled in from the library.  Normally only functions are in library, and only functions that get called by other modules in the project get included in the project.  There must have been something funky done to retain these library sections.  I'm not on the C2000 software team, so I cannot say.  They will have to comment.  I will ping them for you and point them to this forum post.

    Regards,

    David

  • Thanks for finding David!

    So the hack you made is just to build or it can be used in production code also? If not,

    1. I need to build the driverlib myself correctly or

    2. Use the source files instead of driverlib rt ?

    Thanks,

    Prakash

  • Prakash and David,

    I am the one who put these in the driver library, but I have a reason for doing so.  The goal of this was to try to eliminate steps when a user is configuring a new project and to help prevent novice users from accidentally locking their device.  With these in the library the user has one less file to link in and by default every project using the driver library now has these locations filled with 0xFFFF, a completely safe value to program there.  This also has the added benefit of thowing an error like you received above to let a user know they are trying to program the CSM locations.

    To change these values, the user must deliberately do so and then recompile the driver library.  This helps to put one extra layer of protection between a novice and the code security module.  Setting up CSM is still extremely easy as a project for the driver library is included in the package.  Simply import the driver library project in the common folder, open the F2802x_asmfuncs.asm file and modify the CSM fields near the bottom of the file.  Compile the driver library and then recompile your project.

    I know this is different from how this has been done in the past, but I am not satisfied with the status quo and simply trying to improve easy of use.

    Trey

  • Trey,

    I understand your intentions and agree with it. But it would be better if it is documented somewhere (and also mentioned in the wiki). It will save time for newcomers to C2000 family like me.

    Another question:

    Uniflash allows to configure csm sections. So I should be able to link my code with unmodified driverlib and use Uniflash to set the values for csm rt ? Please correct me if my understanding is wrong.

    Thanks,

    Prakash

  • Prakash,

    You are completely correct.  After programming your application using the unmodified driverlib, you can program the CSM locations using Uniflash.

    Trey