thesnake
(thesnake)
September 5, 2025, 8:37am
1
I am writing a little script to make flashing the R4 board easier. I am booting Debian from SD card, and then flash the NAND from there.
The 8G and 4G RAM versions of the board need to be flashed with different BL2.
Question: Is there a way to detect if the board has 4G or 8G, so my script can automatically use the correct BL2?
Thanks!
thesnake
(thesnake)
September 5, 2025, 9:31am
3
Thanks, but unfortunately that does not work in my context.
The SD card that is used to boot for flashing has to use the 4G code, otherwise it would not boot on both 8G and 4G boards.
/proc/meminfo then always shows 4G, even on an 8G board.
ericwoud
(Eric W.)
September 5, 2025, 9:32am
4
You may want to look here, as it also can write to nand, amongst other things
Read the comment to find the nand code
https://github.com/ericwoud/buildR64arch/blob/main/rootfs/bin/bpir-toolbox
thesnake
(thesnake)
September 5, 2025, 9:51am
5
Thanks, but I don’t see how that would help?
That code defaults to 4GB RAM size (line 199), unless it finds something different in ‘/boot/bootcfg’ (using the getconf function).
However, the bootcfg will reflect the current boot RAM size, which again would be 4G on both 4G and 8G boards as the SD card has to always boot in 4G mode.
ericwoud
(Eric W.)
September 5, 2025, 10:35am
6
The example I send you as an example of nand writing (and verifying). It indeed does not help you with the 8gb question.
ericwoud
(Eric W.)
September 5, 2025, 10:39am
7
You may have to resort to asking the user in the script … as is my boot/bootcfg/ddrsize
thesnake
(thesnake)
September 5, 2025, 10:49am
8
… that is what i wanted to avoid
frank-w
(Frank W.)
September 5, 2025, 12:42pm
9
Afaik not as the board needs to be booted with the right bl2 to get ram correctly initialized and size read out