This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

scatter file realview compiler 3.15 at91sam7x

Hello,
i want to put some data at a fixed address(e.g. 0x12dd00),and my programme is loaded starting with address 0x100000 and it take about 0x002000. My scatter file makes it happend but there is one problem, in address range 0x102000(end of programme part) to 0x12dd00(begining of data)it loads 0x00 to every single cell. And i want it to load nothing in this range(0x102000 to 0x12dd00), is it poossible and if yes how to do this.
Thanks in advance.

Parents
  • But should the scatter file produce output after the end of the application code, even if it knows about the full size available?

    Are there no way to tell the scatter load file that the remaining space should be left un-initialized? Everytime the code is modified and recompiled, the size may change. Is there a way to get the scatter file to fill up the last, partial, flash page with 0xff, or to generate a file that doesn't contain this region?

    Limiting the memory region in the scatter file sounds like an ugly hack, unless we are talking about a memory area that should specifically be zero-initialized.

Reply
  • But should the scatter file produce output after the end of the application code, even if it knows about the full size available?

    Are there no way to tell the scatter load file that the remaining space should be left un-initialized? Everytime the code is modified and recompiled, the size may change. Is there a way to get the scatter file to fill up the last, partial, flash page with 0xff, or to generate a file that doesn't contain this region?

    Limiting the memory region in the scatter file sounds like an ugly hack, unless we are talking about a memory area that should specifically be zero-initialized.

Children
  • Hi PerWestermark,

    the scatter loading file is used to describe complex memory images. The scatter loading file is the mediator between your existing physical hardware (memory) and how you want to use it. If you want to use only a part of your flash for code and the remaining part as a flash drive then of course you have to hide the part of flash memory you reserve for different usage. This is a clean approach, very common.

    F

  • I already have a scatter file that reservers room for configuration, and it works great. In my case, I have my configuration as a hole in the middle, since I want specific sector sizes (4kB sectors) for the configuration, while the end of my flash contains 32kB sectors.

    But the OP complained that his resultant file continued to fill zero after the end of the application. Your answer was that the way to stop that was to not show the scatter file all of the flash.

    My question was then if it is the correct and expected behavior of the scatter file to zero-extend the output file.

    If you think about it, the programming time for a chip is directly affected by two things: The erase time, and the number of bytes to transfer and program. In factory, it is easiest to erase the full chip, but when developing or in field it is better to erase only the needed (or specific) sectors, to make sure that any configuration survives the update.

    If an application only needs 64 kB, and the flash is 256kB large, there are 192kB available for the application to grow. But I would expect that the scatter file may know about the full 256kB without trying to fill the last 192kB with zero resulting in four times as much data to program.

    So, I don't have a problem with my scatter file. It does produce a hex file that works for me, and my hex file is not larger than what is needed. But I am wondering about your answer - that the OP must decrease the available size of the flash, to avoid getting a lot of zero data at the end? My scatter file do know about the full flash size, without such a problem. The only think I have done is to tell FlashMagic that it should only erase actually used sectors.

    Might there be some incorrect configuration that the OP has done in his scatter file, since he gets a behaviour I don't get, or does the scatter file has limitations that makes it produce "stupid" output files for some types of configurations?