3 Replies Latest reply on May 23, 2016 3:31 PM by Intel_Alvarado

    How do I know the program/RAM size I used

    augustus

      Hi there,

       

      How do I know the program/RAM size after build my image?

       

      To search map file, I cannot find a summary to describe rom/ram size.

       

       

      B.Rds,

      Augustus

        • 1. Re: How do I know the program/RAM size I used
          Intel_Alvarado

          Hi,

           

          I believe you can find the information you’re looking for in IntelSWTools\ISSM_2016.0.027\firmware\bsp\1.0\examples\flash_access\main.c.

          That file says:

          #include "qm_flash.h"
          
          /*
          * The flash controller segments its memory into pages of 2KB in size
          * (multiples of 0x800). Writes don't cross over to other pages.
          *
          * For Quark Microcontroller D2000, there is 1 flash controller.
          * Controller 0:
          * |  Component                | Size          | System start address
          * |  System ROM              | 8KB    | 0x00000000
          * |  System Flash              | 32KB  | 0x00180000
          * |  Data region | 4KB    | 0x00200000
          *
          * For Quark SE SOC, there are 2 flash controllers.
          * Controller 0:
          * |  Component                | Size          | System start address
          * |  System Flash              | 192KB | 0x40000000
          * |  System ROM              | 8KB          | 0xFFFFE000
          *
          * Controller 1:
          * |  Component                | Size          | System start address
          * |  System Flash              | 192KB | 0x40030000
          */
          

           

          Sergio

          • 2. Re: How do I know the program/RAM size I used
            augustus

            Hi Alvarado,

             

            Forgive my poor English. I don't mean the program memory size of D2000. What I meant is, after I built an image, how should I know what is the percentage of 32KB program memory size I'll use?

             

            I calculated the image size by map file info, it is different with the generated bin file. How should I get the info I need, like how many program memory and how many RAM I use?

             

             

            Augustus

            • 3. Re: How do I know the program/RAM size I used
              Intel_Alvarado

              Take a look at this part of the code of the main.c file https://github.com/01org/qmsi/blob/master/examples/flash_access/main.c

                              QM_PRINTF("Starting: Flash\n");
              
                              app_end = (uint32_t)__data_lma + (uint32_t)__data_size;
              
                              /* Check there is at least one free flash page after the
                              * application code */
                              if ((app_end + flash_page_size) > FLASH_END) {
                                              QM_PRINTF("Error: No free pages. Quitting.\n");
                                              return QM_RC_OK;
                              }
              

               

              Notice the comment that says: Check there is at least one free flash page after the application code.

              One way to determine the size would be to subtract from the 32KB the value the value of the free flash pages.

               

              Sergio