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.

CC3220S-LAUNCHXL: What is the map of 0x20004000 to END of RAM?

Part Number: CC3220S-LAUNCHXL
Other Parts Discussed in Thread: CC3220S

in swru464.pdf page 49 Figure 6-1. CC3220 and CC3220S Device SRAM

Exclusively for application. application should be  part of this region and start at 0x20004000. exclude the application, what else in 0x20004000 to END of RAM? Is there any more detail map of these RAM?

The amount of RAM used by the bootloader is 16KB, which implies that for the CC3220S and CC3220 variants, but in my code(I'm using CC3220S) there are 20 749 bytes of readwrite data memory is bigger than 16KB, other RAM is in the range of 0x20004000 to END of RAM?

87 530 bytes of readonly code memory
26 783 bytes of readonly data memory
20 749 bytes of readwrite data memory

  • Hi user4774248,

    I'm not sure where you're getting those numbers for code/data memory. The CC3220 has unified code/data memory, and other than the requirement that your application has to start at 0x20004000, you can put anything else you want in RAM in any order you wish. Thus, there is no detailed map of RAM; the contents and layout of RAM is up to your application.

    Of course, the linker will typically handle the allocation of RAM. If you look at the CC3220S_LAUNCHXL_TIRTOS.cmd file, there is some config for the linker there. As the CC3220S does not have internal flash, the .cmd file is very simple as everything needs to be put in RAM.

    You can also look at the linker file output in the /debug folder of your project once it is built (the .map file) to see how the linker arranged all of your application's code and data in RAM.

    Regards,
    Michael
  • hi Michael:

    thank you for your reply. The numbers for code/data memory is the map of my network terminal project. In my network_terminal_CC3220S_LAUNCHXL_TIRTOS.icf file it defined SRAM as below:

    // SRAM size of 240KB for CC32XX ES 1.33 device
    define region SRAM = mem:[from 0x20004000 to 0x2003C000];

    that is my RAM and CODE is shared these 224k bytes SRAM and their size is not fixed?

    How do separate RAM and CODE by defined in the icf file?

    I want load my code in the flash and execute it by code below. but it always stop code when execute iRetVal = sl_FsRead(DeviceFileHandle,0, (unsigned char *)APP_IMG_SRAM_OFFSET,
    pFsFileInfo.Len ); and seems  the code run away

    #define APP_IMG_SRAM_OFFSET     0x20004000

    void LoadAndExecute(unsigned char *ImgName, unsigned long ulToken)
    {
    long DeviceFileHandle = -1;
    //
    // Open the file for reading
    //
    DeviceFileHandle = sl_FsOpen(ImgName, SL_FS_READ,
    &ulToken);
    //
    // Check if successfully opened
    //
    if( 0 == iRetVal )
    {
    //
    // Get the file size using File Info structure
    //
    iRetVal = sl_FsGetInfo(ImgName, ulToken,&pFsFileInfo);

    //
    // Check for failure
    //
    if( 0 == iRetVal )
    {

    //
    // Read the application into SRAM
    //
    iRetVal = sl_FsRead(DeviceFileHandle,0, (unsigned char *)APP_IMG_SRAM_OFFSET,
    pFsFileInfo.Len );

    //
    // Stop the network services
    //
    //sl_Stop(30);

    //
    // Execute the application.
    //
    Run(APP_IMG_SRAM_OFFSET);
    }
    }
    }

  • Hi user4774248,

    Well, I suspect what is happening is that your sl_FsRead() call is overwriting the code your device is currently running, since the bootloader on the CC3220 starts execution of your program at 0x20004000.

    What you can try doing is setting aside a section of RAM that will be used exclusively for your loaded code. If you look in your CC3220S_LAUNCHXL_TIRTOS.cmd file, you will notice that your memory is split into a SRAM0 section and a SRAM section. Right below that is a set of section allocations to tell the linker to put all of the code, data, etc into SRAM and not touch the SRAM0 section (which is the bootloader section). Similarly, you can declare your own memory region in RAM and then not assign any sections to it, which allows you to reserve a section of RAM for the code you want to load. Something like this:

    MEMORY
    {
        SRAM0 (RWX) : origin = 0x20000000, length = 0x4000
        SRAM  (RWX) : origin = 0x20004000, length = 0x1E000
        SRAM_R (RWX) : origin = 0x20022000, length = 0x1E000
    }

    Try doing that and then doing your sl_FsRead() into the base address of your reserved RAM.

    Regards,

    Michael

  • hi, Michael:

    thank you! You give me a great help!

    You said to change the CC3220S_LAUNCHXL_TIRTOS.cmd file to add a memory section. The cmd file seem used for ccs? 

    can I do it like the picture below? I'm using IAR. How to change the icf file to fit my requirement?

  • Hi user4774248,

    What you could do is define a SRAM_R region in your icf file. Something like this:

    // Define a region for the on-chip SRAM.
    define region SRAM = mem:[from 0x20004000 to 0x2000FFFF];
    
    // Define a region for the application code
    define region SRAM_R = mem:[from 0x20010000 to 0x20040000];

    That should cause it to reserve that region for your application code. You should look up some IAR guides on the icf file for reference, as I only use CCS and am not so sure of all the workings of the IAR icf file.

    Regards,

    Michael