<div dir="ltr"><div>Hello David,</div><div><br></div>Thanks for commands usage .<div><br></div><div>For the command:</div><div><div><div style="font-size:12.8px">dd if=test2.bin of=test.bin bs=1 seek=$((0x1a1e0)) conv=notrunc</div><div style="font-size:12.8px"></div></div></div><div><br></div><div>It is subtle when you are mentioning bs=1, If we donot specify bs, it will take a default value of 512 I suppose, then seek will be (0x1a1e0)*512 which will skip lot of bytes from the beginning of the file.</div><div><br></div><div> So, we cannot use a layout file to write to a specific region.</div><div><br></div><div>Rgds,</div><div><br></div><div><div style="font-size:12.8px"><br></div></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 2, 2016 at 1:31 AM, David Hendricks <span dir="ltr"><<a href="mailto:dhendrix@chromium.org" target="_blank">dhendrix@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Mon, Aug 1, 2016 at 9:59 AM, Pradeep Ch <span dir="ltr"><<a href="mailto:shanmugp@sysargus.com" target="_blank">shanmugp@sysargus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><p dir="ltr">How do I pad the bootloader. img to 8MBytes ? But, still it occupies the first 106976 Bytes right ? Remaining space is empty I suppose.</p></blockquote></span><div>To create a 8MB file full of 0xff bytes:</div><div>dd if=/dev/zero bs=1k count=8192 2>/dev/null | tr "\000" "\377" > test.bin<br></div><div><br></div><div>From there, you can use dd with skip=, seek=, and conv=notrunc to place your content wherever you need to in the image. For example,</div><div>dd if=test1.bin of=test.bin bs=1 conv=notrunc</div><div>dd if=test2.bin of=test.bin bs=1 seek=$((0x1a1e0)) conv=notrunc</div><div><div><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<p dir="ltr">Thanks.</p><div><div>
<div class="gmail_quote">On Aug 1, 2016 9:08 PM, "Urja Rannikko" <<a href="mailto:urjaman@gmail.com" target="_blank">urjaman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Mon, Aug 1, 2016 at 10:33 AM, Pradeep Ch <<a href="mailto:shanmugp@sysargus.com" target="_blank">shanmugp@sysargus.com</a>> wrote:<br>
><br>
> I am attempting to write to a flashrom using layout/region approach.<br>
> The NOR flash size is 8MBytes. The file size I am writing is 106976 Bytes.<br>
><br>
> The rom.layout file contents are:<br>
>  00000000:0001a1df test1<br>
>  0001a1e0:007fffff test2<br>
><br>
> The command I am using is:<br>
> ./flashrom -p ft2232_spi:type=arm-usb-ocd --layout rom.layout --image test1<br>
> -w bootloader.img<br>
><br>
> The error I am getting is :<br>
> Using region: "test1".<br>
> Calibrating delay loop... OK.<br>
> Found Eon flash chip "EN25Q64" (8192 kB, SPI) on ft2232_spi.<br>
> Error: Image size (106976 B) doesn't match the flash chip's size (8388608<br>
> B)!<br>
><br>
> Please let me know about the error.<br>
<br>
The current layout system will only limit the actually written area,<br>
not change the requirements of the flash file being the size of the<br>
chip, so in this case you'd need to pad the bootloader.img to 8MB.<br>
</blockquote></div>
</div></div><br></span>_______________________________________________<br>
flashrom mailing list<br>
<a href="mailto:flashrom@flashrom.org" target="_blank">flashrom@flashrom.org</a><br>
<a href="https://www.flashrom.org/mailman/listinfo/flashrom" rel="noreferrer" target="_blank">https://www.flashrom.org/mailman/listinfo/flashrom</a><span class="gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.</div>
</font></span></div></div>
</blockquote></div><br></div></div>