Re: "dummy-flash" device tree possible bug?


Michael Hope <michaelh@...>
 

Hi Diego.  Looks like Maureen has pointed you in the right direction.  Thanks Maureen!

-- Michael

On Thu, 8 Feb 2018 at 06:59 Diego Sueiro <diego.sueiro@...> wrote:
Hello Michael,

On 7 February 2018 at 19:27, Michael Hope <michaelh@...> wrote:
Hi Diego.  zephyr,flash sets where the main code is stored and is used to calculate the address and size of the code section.  In your case it probably doesn't make sense as you'll probably store things in DRAM on the i.MX7.

If I was you I'd leave a fake flash entry in the dts file and use it to set the RAM load address.

You mean setting the same entry for the flash and sram? Something like that?

chosen {
        zephyr,flash = &ocram;
        zephyr,sram = &ocram;
        zephyr,console = &uart2;
    }; 

What is the usage and purpose of "dummy-flash"? I belive it can be used when you want to use a debugger to load and execute the code directly in the sram.

Getting the elf header of this 2 different approaches we have:

1) zephyr,flash = zephyr,sram:
Memory region         Used Size  Region Size  %age Used
           FLASH:          16388 B       128 KB        12.50%
            SRAM:          7332 B         128 KB         5.59%
        IDT_LIST:            36 B           2 KB            1.76%

Program Headers:
  Type           Offset        VirtAddr        PhysAddr     FileSiz    MemSiz  Flg    Align
  LOAD          0x0000b4 0x20200000 0x20200000 0x0343a 0x0343a RWE 0x4
  LOAD          0x0034f0  0x20200000 0x20200000 0x00000 0x01ba8 RW   0x8
  LOAD          0x0034f0  0x2020343c 0x2020343c  0x00acc 0x00acc RW    0x4
  LOAD          0x003fbc  0x20201ba8 0x20203f08   0x000fc 0x000fc  RW    0x4

Section to Segment mapping:
  Segment Sections...
   00     text bss noinit 
   01     bss noinit 
   02     devconfig rodata 
   03     datas initlevel initshell 


2) no zephyr,flash in dts (and with my "fix"):
Memory region         Used Size  Region Size  %age Used
           FLASH:              0 GB         0 GB              -nan%
            SRAM:            23348 B     112 KB           20.36%
        IDT_LIST:             36 B           2 KB              1.76%

Program Headers:
  Type           Offset       VirtAddr        PhysAddr      FileSiz    MemSiz Flg    Align
  LOAD         0x000078 0x20200000 0x20200000 0x03e90 0x05a38 RWE 0x8
  LOAD         0x003f08  0x20205a38 0x20205a38 0x000fc  0x000fc  RW    0x4

Section to Segment mapping:
  Segment Sections...
   00     text devconfig rodata bss noinit 
   01     datas initlevel initshell


Join {devel@lists.zephyrproject.org to automatically receive all group messages.