<p>tsaitgaist has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16866">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">reserve RAM for DFU magic<br><br>this changes the linker script so the first word (smallest unit<br>since the data needs to be 4 baty aligned) is not reserved for<br>the RAM section.<br>this allows the application to write any data at this address<br>without the rest of the code messing with the content.<br>since the SRAM is preserved after reset, this allows to share<br>data between firmware.<br>in particular it allows the application to tell the bootloader it<br>should start the flashing procedure.<br>this is already implemented in the osmo-asf4-dfu DFU bootloader.<br>if the application wants to switch to the DFU bootloader, write<br>the DFU magic 0x44465521 (DFU!) at the beginning of RAM at address<br>(uint32_t*)HSRAM_ADDR, and perform a system reset.<br><br>Change-Id: Ibafd08429b05fd3cab6af060904201db83186a4e<br>---<br>M sysmoOCTSIM/gcc/gcc/same54n19a_dfu.ld<br>M sysmoOCTSIM/gcc/gcc/same54n19a_flash.ld<br>2 files changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/66/16866/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/sysmoOCTSIM/gcc/gcc/same54n19a_dfu.ld b/sysmoOCTSIM/gcc/gcc/same54n19a_dfu.ld</span><br><span>index 7d76cc2..17fc417 100644</span><br><span>--- a/sysmoOCTSIM/gcc/gcc/same54n19a_dfu.ld</span><br><span>+++ b/sysmoOCTSIM/gcc/gcc/same54n19a_dfu.ld</span><br><span>@@ -36,7 +36,8 @@</span><br><span> MEMORY</span><br><span> {</span><br><span>   rom      (rx)  : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K</span><br><span style="color: hsl(0, 100%, 40%);">-  ram      (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000</span><br><span style="color: hsl(120, 100%, 40%);">+  /* The first word of the RAM is used for the DFU magic */</span><br><span style="color: hsl(120, 100%, 40%);">+  ram      (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 0x00030000 - 4</span><br><span>   bkupram  (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000</span><br><span>   qspi     (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000</span><br><span> }</span><br><span>diff --git a/sysmoOCTSIM/gcc/gcc/same54n19a_flash.ld b/sysmoOCTSIM/gcc/gcc/same54n19a_flash.ld</span><br><span>index 33b8ed9..ce30971 100644</span><br><span>--- a/sysmoOCTSIM/gcc/gcc/same54n19a_flash.ld</span><br><span>+++ b/sysmoOCTSIM/gcc/gcc/same54n19a_flash.ld</span><br><span>@@ -36,7 +36,8 @@</span><br><span> MEMORY </span><br><span> { </span><br><span>   rom      (rx)  : ORIGIN = 0x00000000, LENGTH = 0x00080000 </span><br><span style="color: hsl(0, 100%, 40%);">-  ram      (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 </span><br><span style="color: hsl(120, 100%, 40%);">+  /* The first word of the RAM is used for the DFU magic */ </span><br><span style="color: hsl(120, 100%, 40%);">+  ram      (rwx) : ORIGIN = 0x20000000 + 4, LENGTH = 0x00030000 - 4 </span><br><span>   bkupram  (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000 </span><br><span>   qspi     (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000 </span><br><span> } </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16866">change 16866</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16866"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ccid-firmware </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibafd08429b05fd3cab6af060904201db83186a4e </div>
<div style="display:none"> Gerrit-Change-Number: 16866 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: tsaitgaist <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>