<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[u-boot binary too large on compile]]></title><description><![CDATA[<p dir="auto">I am trying to compile basic u-boot binaries using the configuration from here:<br />
<a href="https://github.com/OnionIoT/u-boot/blob/master/configs/onion-omega2p_defconfig" rel="nofollow">https://github.com/OnionIoT/u-boot/blob/master/configs/onion-omega2p_defconfig</a></p>
<p dir="auto">I am able to succesfully compile the make but get a u-boot.bin much larger than expected. I get a u-boot.bin of 487 kb while most images i found from the Onion are arond 170 kb. Moreover the Onion has a 192kb max sixe for the bootloader so was wondering if anyone could help me in the right direction.  Any help would be greatly appreciated</p>
<p dir="auto">Here are the steps i took in Ubuntu 22.04.04</p>
<pre><code>sudo apt-get update
sudo apt-get install build-essential libncurses5-dev bc gcc-multilib
Wget https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt76x8/openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz


tar -xvf openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz 
cd openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64

export STAGING_DIR=$(pwd)/staging_dir
export PATH=$PATH:$STAGING_DIR/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin

export CROSS_COMPILE=mipsel-openwrt-linux-
git clone https://github.com/OnionIoT/u-boot.git
cd u-boot/
make onion-omega2p_defconfig
Make

</code></pre>
]]></description><link>http://community.onion.io/topic/5056/u-boot-binary-too-large-on-compile</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 06:56:15 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/5056.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Jun 2024 17:17:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to u-boot binary too large on compile on Tue, 18 Jun 2024 17:17:36 GMT]]></title><description><![CDATA[<p dir="auto">I am trying to compile basic u-boot binaries using the configuration from here:<br />
<a href="https://github.com/OnionIoT/u-boot/blob/master/configs/onion-omega2p_defconfig" rel="nofollow">https://github.com/OnionIoT/u-boot/blob/master/configs/onion-omega2p_defconfig</a></p>
<p dir="auto">I am able to succesfully compile the make but get a u-boot.bin much larger than expected. I get a u-boot.bin of 487 kb while most images i found from the Onion are arond 170 kb. Moreover the Onion has a 192kb max sixe for the bootloader so was wondering if anyone could help me in the right direction.  Any help would be greatly appreciated</p>
<p dir="auto">Here are the steps i took in Ubuntu 22.04.04</p>
<pre><code>sudo apt-get update
sudo apt-get install build-essential libncurses5-dev bc gcc-multilib
Wget https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt76x8/openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz


tar -xvf openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64.tar.xz 
cd openwrt-sdk-21.02.3-ramips-mt76x8_gcc-8.4.0_musl.Linux-x86_64

export STAGING_DIR=$(pwd)/staging_dir
export PATH=$PATH:$STAGING_DIR/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin

export CROSS_COMPILE=mipsel-openwrt-linux-
git clone https://github.com/OnionIoT/u-boot.git
cd u-boot/
make onion-omega2p_defconfig
Make

</code></pre>
]]></description><link>http://community.onion.io/post/25963</link><guid isPermaLink="true">http://community.onion.io/post/25963</guid><dc:creator><![CDATA[baby Onioneer]]></dc:creator><pubDate>Tue, 18 Jun 2024 17:17:36 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Thu, 20 Jun 2024 15:11:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/9151">@baby-Onioneer</a> Just use these steps:</p>
<p dir="auto">git clone <a href="https://github.com/OnionIoT/omega2-bootloader.git" rel="nofollow">https://github.com/OnionIoT/omega2-bootloader.git</a><br />
cd omega2-bootloader<br />
./setup_env.sh<br />
make</p>
<p dir="auto">You can check the repo for any other details you may need.</p>
]]></description><link>http://community.onion.io/post/25966</link><guid isPermaLink="true">http://community.onion.io/post/25966</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Thu, 20 Jun 2024 15:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Thu, 20 Jun 2024 17:48:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a> said in <a href="/post/25966">u-boot binary too large on compile</a>:</p>
<blockquote>
<p dir="auto">git clone <a href="https://github.com/OnionIoT/omega2-bootloader.git" rel="nofollow">https://github.com/OnionIoT/omega2-bootloader.git</a></p>
</blockquote>
<p dir="auto">I did succesfully compile that one before but dont see a defconfig file for me to edit and play with, which is why I was using the other git repo. Am I incorrect there and there is a defconfig file I can edit? I found nothing from a find command.</p>
]]></description><link>http://community.onion.io/post/25973</link><guid isPermaLink="true">http://community.onion.io/post/25973</guid><dc:creator><![CDATA[baby Onioneer]]></dc:creator><pubDate>Thu, 20 Jun 2024 17:48:44 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Fri, 21 Jun 2024 03:19:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/9151">@baby-Onioneer</a> There's no defconfig I have seen in that repo.  There a are stack of them for various devices under the main build system. Look in the &lt;build root&gt;/build-dir/hosts/&lt;u-boot version&gt;/configs. Nothing specific to the Omega2 there.</p>
]]></description><link>http://community.onion.io/post/25974</link><guid isPermaLink="true">http://community.onion.io/post/25974</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Fri, 21 Jun 2024 03:19:05 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Fri, 21 Jun 2024 12:33:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a> Thank</p>
]]></description><link>http://community.onion.io/post/25984</link><guid isPermaLink="true">http://community.onion.io/post/25984</guid><dc:creator><![CDATA[baby Onioneer]]></dc:creator><pubDate>Fri, 21 Jun 2024 12:33:20 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Mon, 03 Feb 2025 15:13:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a> I got here thanks to your hint <a href="https://community.onion.io/post/26178" rel="nofollow">in the GPIO44 question thread</a> because to free GPIO44 from being switched to output I need to build my own bootloader.</p>
<p dir="auto">Now I see that <code>setup_env.sh</code> as a first step unpacks a precompiled buildroot/toolchain for an x86 linux host. However I don't have such a thing, my platform is 64bit ARM.</p>
<p dir="auto">But of course I do have a working mips toolchain built for 64bit ARM as part of the openwrt build. What is the reason to not use the openwrt build environment to build uboot and rather use that pre-packaged buildroot instead?</p>
]]></description><link>http://community.onion.io/post/26185</link><guid isPermaLink="true">http://community.onion.io/post/26185</guid><dc:creator><![CDATA[luz]]></dc:creator><pubDate>Mon, 03 Feb 2025 15:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Mon, 03 Feb 2025 17:06:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> An interesting question I asked myself when dealing with Omega2Pro flappy GPIO44 issue.  I found I could modify the makefile to point to my standard buildroot, however I needed to install gcc-multilib and then it worked fine.  I didn't investigate why, perhaps <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a> knows.</p>
]]></description><link>http://community.onion.io/post/26186</link><guid isPermaLink="true">http://community.onion.io/post/26186</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Mon, 03 Feb 2025 17:06:57 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Mon, 03 Feb 2025 20:02:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a>, <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a> having cross-links between build environments, pre-built x86 binaries etc. feels a bit brittle to me, so what I would like to do is getting uboot for omega2 built as an openwrt package.</p>
<p dir="auto">This is something that already exists (see <code>package/boot/uboot-ramips</code>) in openwrt for another MT76x8 target, the RAVPower RP-WD009.</p>
<p dir="auto">So I copied that package to make an <a href="https://github.com/plan44/plan44-feed/tree/main/uboot-omega2" rel="nofollow">uboot-omega2 package</a> and made it use <a href="https://github.com/plan44/omega2-bootloader" rel="nofollow">my fork of omega2-bootloader</a> (Once this builds, I'll kill the fork and make the needed changes a patchset in the uboot-omega2 package, but for now it's easier to work this way)</p>
<p dir="auto">At the moment the build fails very early, because the openwrt <code>u-boot.mk</code> is made for the upstream u-boot sources whereas the omega2 version has forked off from 1.1.3 version <a href="https://github.com/u-boot/u-boot/commits/f4733a0764741966a5e842968166b40fb062d577" rel="nofollow">from upstream about here</a> and includes some static config that the standard build process is trying to generate.</p>
<p dir="auto">Any help or pointers how to get that right are welcome, it's a bit of a mess right now <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--wink" title=";-)" alt="😉" /></p>
<p dir="auto">[Update hours later:] looks like a huge pain, nothing works as it should, down to C files giving errors because some 1000 fold-nested macros in io.h expand to invalid assembler instructions <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--cry" title=":cry:" alt="😢" /></p>
<pre><code>{standard input}:2896: Error: operand 2 must be an immediate expression `lb $2,$4($2)'
</code></pre>
<p dir="auto">somehow originating from assember generated from compiling<code>drivers/ohci-hcd.c</code>:</p>
<pre><code>#APP
 # 309 "/Volumes/CaseSens/openwrt-2/build_dir/target-mipsel_24kc_musl/uboot-omega2-plan44_p44dsbomega2/uboot-omega2-4.3.0.3/include/asm/io.h" 1
	lb	$2,$4($2)
 # 0 "" 2
$LVL204 = .
	.loc 3 309 1 view $LVU687
	.loc 3 309 1 is_stmt 0 view $LVU688
#NO_APP
</code></pre>
]]></description><link>http://community.onion.io/post/26188</link><guid isPermaLink="true">http://community.onion.io/post/26188</guid><dc:creator><![CDATA[luz]]></dc:creator><pubDate>Mon, 03 Feb 2025 20:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Tue, 04 Feb 2025 02:43:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> can you give me the steps you followed and on what OpenWrt release.  I can see if I can find the issue, maybe two heads are better than one.</p>
]]></description><link>http://community.onion.io/post/26189</link><guid isPermaLink="true">http://community.onion.io/post/26189</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Tue, 04 Feb 2025 02:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Tue, 04 Feb 2025 14:01:41 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a> ...maybe two heads are better than one.</p>
</blockquote>
<p dir="auto">certainly <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":-)" alt="🙂" /> !</p>
<p dir="auto">This is what I tried so far:</p>
<ul>
<li>on OpenWrt 22.03.5</li>
<li>copied the existing uboot package from <code>package/boot/uboot-ramips</code> into my own package feed as <code>plan44/uboot-omega2</code></li>
<li>modified the package makefile to pull sources from omega2-bootloader instead of u-boot upstream as in the original Makefile. You can find the changed version <a href="https://github.com/plan44/plan44-feed/commit/973fc4509a91186772a89e7cf8b9bf44f80fc630" rel="nofollow">here on github</a>.</li>
<li>Tried to <code>make package/uboot-omega2/compile</code></li>
<li>Realized that one of the main difference between official upstream way to build uboot and the omega version is that the omega2-bootloader repo is pre-configured, i.e. it contains <code>.config</code>, <code>autoconf.h</code> etc. prebuilt so I must <strong>prevent</strong> running <code>config.mk</code>, see <a href="https://github.com/plan44/omega2-bootloader/commit/f3ea2d3ba9f5a62d8f31f461b86d015f0b2a48cb" rel="nofollow">this change</a></li>
<li>Also I needed to disable the pre-built-toolchain in the uboot Makefile, see <a href="https://github.com/plan44/omega2-bootloader/commit/990de5cc0ef4587905fc98389ed6c1c03bb73b34" rel="nofollow">this change</a></li>
<li>The <a href="https://github.com/plan44/omega2-bootloader/commits/main/" rel="nofollow">other commits on top of omega2-bootloader</a> were other details I had to fix while trying to compile, some probably caused by my platform (macOS on ARM64).</li>
<li>At the moment, I also need to run<br />
<code>export CROSS_COMPILE=mipsel-openwrt-linux-</code><br />
before calling make. Of course that should go into the package makefile later.</li>
</ul>
<p dir="auto">With this, the build runs through around 20 *.c files successfully and then stops in <code>drivers/ohci-hcd.c</code> with the aforementioned <code>Error: operand 2 must be an immediate expression 'lb $2,$4($2)'</code>problem.</p>
<p dir="auto">In the meantime I found that this comes from the macros in <code>io.h</code> that are translating I/O port accesses (x86 architecture has separate I/O address space) into single-address space instructions like we have on the MT7688.</p>
<p dir="auto">Most probably the problem is not in ohci-hcd.c nor in io.h, but in some parameter coming from the build environment, I guess… But I'm currently out of ideas of how to proceed...</p>
<p dir="auto">I hoped that with OpenWrt natively providing a build environment for u-boot this would be relatively straightforward, but it seems quite the opposite right now <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--disappointed" title=":-(" alt="😞" /></p>
]]></description><link>http://community.onion.io/post/26191</link><guid isPermaLink="true">http://community.onion.io/post/26191</guid><dc:creator><![CDATA[luz]]></dc:creator><pubDate>Tue, 04 Feb 2025 14:01:41 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Wed, 05 Feb 2025 17:43:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> take a look at <a href="https://github.com/crispyoz/omega2-bootloader" rel="nofollow">my fork</a> of your fork. The issue seems to be caused by the use of extern inline in io.h and bitops.h if you change them to static inline it fixes the assembler issue.</p>
<p dir="auto">Once that's sorted there as some other stuff to fix but I haven't had time to look at this yet.</p>
]]></description><link>http://community.onion.io/post/26193</link><guid isPermaLink="true">http://community.onion.io/post/26193</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Wed, 05 Feb 2025 17:43:52 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Fri, 07 Feb 2025 20:00:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> said in <a href="/post/26188">u-boot binary too large on compile</a>:</p>
<blockquote>
<p dir="auto">having cross-links between build environments, pre-built x86 binaries etc. feels a bit brittle to me, so what I would like to do is getting uboot for omega2 built as an openwrt package.</p>
</blockquote>
<p dir="auto">I agree, it is brittle. It was something we put in place back when x86 was the only game in town for desktop computing <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--wink" title=";)" alt="😉" /></p>
<p dir="auto">We also noticed the OpenWRT build system has an option to build the bootloader, but haven't explored that path yet.</p>
<p dir="auto">Like I mentioned in the <a href="https://community.onion.io/topic/3839/omega2s-sys_led-pin/11" rel="nofollow">Omega2S+ sys_led pin thread</a>, we're contemplating moving to a more modern u-boot. I think this would give us more impact for the time spent.<br />
And we could set it up to be less brittle from the get go.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6184">@crispyoz</a> let me know your thoughts and if you're interested in collaborating on this!</p>
]]></description><link>http://community.onion.io/post/26195</link><guid isPermaLink="true">http://community.onion.io/post/26195</guid><dc:creator><![CDATA[Lazar Demin]]></dc:creator><pubDate>Fri, 07 Feb 2025 20:00:00 GMT</pubDate></item><item><title><![CDATA[Reply to u-boot binary too large on compile on Sat, 08 Feb 2025 01:53:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a> a lot of the issues I'm seeing are caused because of the build tools version gcc 3.4.2 (released 2004), which is 9 major release behind the current 12/13 (I'm using OWRT 23).  The issue <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1033">@luz</a> posted is not so unexpected due to the many changes related to how extern and inline has been implemented/standardised in the last 20 years.</p>
<p dir="auto">As time permits I'm working though some of the these issues, but keep wondering if as you mentioned it would be better to spend time moving to a modern u-boot.  I wonder if we could move to the modern u-boot but patch it to reduce size, or is it better to wait for the Omega3  <img src="http://community.onion.io/plugins/nodebb-plugin-emoji/emoji/android/1f61c.png?v=ic093v0mjao" class="not-responsive emoji emoji-android emoji--stuck_out_tongue_winking_eye" title=":stuck_out_tongue_winking_eye:" alt="😜" /></p>
]]></description><link>http://community.onion.io/post/26197</link><guid isPermaLink="true">http://community.onion.io/post/26197</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Sat, 08 Feb 2025 01:53:56 GMT</pubDate></item></channel></rss>