Yocto build (RockPiS) - edit uEnv.txt to increase RAM by setting extraargs=swiotlb=1024

Hi, I’m using RockPiS with 1GB NAND, and I’m trying to build a custom image with the maximum free storage space.

I followed this https://wiki.radxa.com/Yocto-layer-for-radxa-boards tutorial with the help of this thread Investigating smallest possible Debian Rootfs for RockPi-S.
I’ve removed some unnecessary packages and successfully built the image.

Everything works just fine (so far), but I also want to increase the available amount of RAM.

In FAQs I found that adding line extraargs=swiotlb=1024 to /boot/uEnv.txt will do the trick.

Unfortunately, with the custom image I’ve built, I don’t have this file in /boot dir. I tried to create it, but no luck.

I found that uEnv.txt file exists in meta-radxa/recipes-bsp/u-boot/files/rockpi-s-rk3308/uEnv.txt . But when I tried to modify it I get ERROR: Task (/workdir/poky/build/../meta-radxa/recipes-bsp/u-boot/u-boot-rockpi-s.bb:do_fetch) failed with exit code '1'

I assume it is because it is detecting changes in git directory compared with some fixed revision.

So the question is, how I can modify uEnv or anything else to increase the total RAM available?

Thank you for any help!

I figure it out. It’s on the second partition:

root@rockpi-s-rk3308:~# lsblk 
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1     179:0    0  964M  0 disk 
|-mmcblk1p1 179:1    0  112M  0 part 
`-mmcblk1p2 179:2    0  836M  0 part /

So after mounting it

mkdir  /mnt/p1
mount /dev/mmcblk1p1 /mnt/p1
ls /mnt/p1
> Image  boot.cmd  boot.scr  extlinux  overlays  rk3308-rock-pi-s.dtb  uEnv.txt

After adding mentioned line:

free -h
              total        used        free      shared  buff/cache   available
Mem:          234Mi        36Mi       131Mi        16Mi        66Mi       173Mi
Swap:            0B          0B          0B

:tada:

But would still be great to know how to modify uEnv.txt during building the image, so I don’t need to do it for every device :wink:
Maybe @nish or @Stephen would know?

Never mind. The first method that I described by modifying meta-radxa/recipes-bsp/u-boot/files/rockpi-s-rk3308/uEnv.txt and then running bitbake -k radxa-console-image is working.

I tried it one more time from scratch, and it worked. So the first error was probably related to something else when I tried to find the solution and accidentally broke something.