How to create a new section under the code section

Hello,

I'm trying to create a new section under the code section with the section Viewer but it does not work. After define it in the section Viewer the linker give me this warning:

-->W0561100: cannot find "PDownloadPRG" specified in Option start

The new section ( "PDownloadPRG") appear in the section Viewer but it is not Display in the Memory usage window on e2studio like the other sections.
I would like to know how to configure the new section in the section Viewer so that I can see it in the Memory usage window like all other sections.

Can anyone help me!

  • I Forgot, I'm using the toolchain ccrx v2.07.00.
  • Hi Romi,

    Were you able to find answers regarding your question?

    JB
    RenesasRulz Forum Moderator
  • The warning says that the section PDownloadPRG is not being used. The linker options say there could be a section PDownloadPRG , but it is not being used in any code file. So there is nothing to see in the memory usage window.

  • In reply to JB:

    Hi JB,
    I threw a look in the sample code of the Project: "USB Host Flash Boot Loader". A new section (D_flash_api_sec) has been define for the downloaded code in the dbsct.c file like this:

    #pragma section $DSEC
    extern const struct {
    _UBYTE *rom_s; /* Start address of the initialized data section in ROM */
    _UBYTE *rom_e; /* End address of the initialized data section in ROM */
    _UBYTE *ram_s; /* Start address of the initialized data section in RAM */
    } _DTBL[] = {
    { __sectop("D"), __secend("D"), __sectop("R") },
    { __sectop("D_2"), __secend("D_2"), __sectop("R_2") },
    { __sectop("D_1"), __secend("D_1"), __sectop("R_1") },

    // Flash table
    { __sectop("D_flash_api_sec"), __secend("D_flash_api_sec"), __sectop("R_flash_api_sec") },
    { __sectop("PFRAM"), __secend("PFRAM"), __sectop("RPFRAM") },
    };

    I did the same and the new section appear in the Memory usage window, but the section group for my new section is "Others" instead of "program" like for the section P. Am I missing somethhing oder everything is fine?

    Thank you for your answer!
    Romi
  • In reply to romi:

    The code you mention has NOTHING to do with section definitions. This code defines arrays used for data initialization in _INITSCT() in resetprg.c.
    Section definition is done in the linker options.
    Section usage is done using #pragma section instructions in the code.
    I don't understand what you mean by "Memory usage window".
  • In reply to FrankL:

    Hallo FrankL,
    you are right, I have done it only with the section Viewer and it works. I'm using e2studio and in the Memory usage window you can see all sections and their adresses.
  • In reply to romi:

    I have another question, do I need to do a RAM to ROM Mapping, wenn I'm adding a new section for the downloaded code?
    I'm asking because by doing this "{ __sectop("D_flash_api_sec"), __secend("D_flash_api_sec"), __sectop("R_flash_api_sec") }" in the sample Project as I wrote above, the mapping is done!
  • In reply to romi:

    The mapping you cite does NOT copy code to RAM. This line copies initialzation data for initialized variables from ROM to RAM. Sections D_xxx and R_xxx are data sections.
    Program copy to FCU RAM is done in function flash_init() in file r_flash_api_rx600.c.
  • In reply to romi:

    romi,

    Has your question been answered?

    Mike Clements
    RenesasRulz Moderator