5

I am using Yocto to build a custom image for my Raspberry Pi2. Followed this tutorial in portuguese and this one in english.

QUESTION 1: Why my config.txt (added by hand) isn't loaded?

I was able to generate my image and my Pi2 booted nicely. Now the distribution I have doesn't have a /boot/config.txt, so I did add one by hand, but It doesn't look like it taking it into account.

QUESTION 2: How do I tell Yocto to create a config.txt with these variables?

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (here we are forcing 800x480!)
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0

max_usb_current=1
zabumba
  • 257
  • 1
  • 7
  • 20

2 Answers2

4

Answer to QUESTION 1 (Read Comments section down below question)

The config.txt is read from the FAT32 partition!!! The config.txt I added has no effect indeed. It can't. Read Comment section below.

Partitions

devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
root@raspberrypi2:/# fdisk -l

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 32 sectors/track, 121280 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1   *          65         384       20480   c Win95 FAT32 (LBA)
/dev/mmcblk0p2             385        7104      430080  83 Linux

root

root@raspberrypi2:/# ls -al /
drwxr-xr-x   17 root     root          1024 Jan  1  1970 .
drwxr-xr-x   17 root     root          1024 Jan  1  1970 ..
drwxr-xr-x    2 root     root          2048 May 24 19:10 bin
drwxr-xr-x    2 root     root          1024 May 24 19:18 boot
drwxr-xr-x   14 root     root         13240 May 24 19:11 dev
drwxr-xr-x   33 root     root          2048 Jan  1  1970 etc
drwxr-xr-x    3 root     root          1024 May 24 19:09 home
drwxr-xr-x    6 root     root          2048 May 24 19:11 lib
drwx------    2 root     root         12288 May 24 19:11 lost+found
drwxr-xr-x    2 root     root          1024 May 22 14:35 media
drwxr-xr-x    2 root     root          1024 May 22 14:35 mnt
dr-xr-xr-x   88 root     root             0 Jan  1  1970 proc
drwxr-xr-x    8 root     root           380 May 24 19:11 run
drwxr-xr-x    2 root     root          2048 May 24 19:10 sbin
dr-xr-xr-x   11 root     root             0 Jan  1  1970 sys
lrwxrwxrwx    1 root     root             8 Jan  1  1970 tmp -> /var/tmp
drwxr-xr-x    9 root     root          1024 May 22 15:21 usr
drwxr-xr-x    8 root     root          1024 May 22 18:43 var

boot folder

root@raspberrypi2:/boot# ls -al
drwxr-xr-x    2 root     root          1024 May 24 19:18 .
drwxr-xr-x   17 root     root          1024 Jan  1  1970 ..
lrwxrwxrwx    1 root     root            19 May 24 19:10 Image -> /boot/Image-3.18.11
-rw-r--r--    1 root     root       8648032 May 22 20:15 Image-3.18.11
-rw-r--r--    1 root     root          1247 May 24 19:18 config.txt

Created /boot/rpi and mounted the FAT32 partition

root@raspberrypi2:/boot# mount /dev/mmcblk0p1 /boot/rpi
root@raspberrypi2:/boot# ls -al
drwxr-xr-x    3 root     root          1024 May 24 19:16 .
drwxr-xr-x   17 root     root          1024 Jan  1  1970 ..
lrwxrwxrwx    1 root     root            19 May 24 19:10 Image -> /boot/Image-3.18.11
-rw-r--r--    1 root     root       8648032 May 22 20:15 Image-3.18.11
-rw-r--r--    1 root     root          1247 May 24 19:18 config.txt  <=== DELETE THIS
drwxr-xr-x    3 root     root         16384 Jan  1  1970 rpi <===

root@raspberrypi2:/boot# cd rpi

root@raspberrypi2:/boot/rpi# ls -al
drwxr-xr-x    3 root     root         16384 Jan  1  1970 .
drwxr-xr-x    3 root     root          1024 May 24 19:16 ..
-rwxr-xr-x    1 root     root          4702 May 24 12:12 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x    1 root     root          4423 May 24 12:12 bcm2708-rpi-b.dtb
-rwxr-xr-x    1 root     root          5690 May 24 12:12 bcm2709-rpi-2-b.dtb
-rwxr-xr-x    1 root     root             0 May 24 12:12 bcm2835-bootfiles-20150206.stamp
-rwxr-xr-x    1 root     root         17856 May 24 12:12 bootcode.bin
-rwxr-xr-x    1 root     root           117 May 24 12:12 cmdline.txt
-rwxr-xr-x    1 root     root         32874 May 24 12:12 config.txt
-rwxr-xr-x    1 root     root          6133 May 24 12:12 fixup.dat
-rwxr-xr-x    1 root     root          2345 May 24 12:12 fixup_cd.dat
-rwxr-xr-x    1 root     root          9191 May 24 12:12 fixup_x.dat
-rwxr-xr-x    1 root     root            54 May 24 12:12 image-version-info
-rwxr-xr-x    1 root     root       8648032 May 24 12:12 kernel7.img
drwxr-xr-x    2 root     root          2048 May 24 12:12 overlays
-rwxr-xr-x    1 root     root       2641752 May 24 12:12 start.elf
-rwxr-xr-x    1 root     root        554008 May 24 12:12 start_cd.elf
-rwxr-xr-x    1 root     root       3598760 May 24 12:12 start_x.elf

Answer to QUESTION 2 (not tested yet but should work)

In your own .bbappend

COMPATIBLE_MACHINE += "raspberrypi2"

In your image config file in IMAGE_INSTALL add the rpi-config module

In [PATH]/meta-rpi/recipes-bsp/bootfiles/rpi-config_git.bbappend create the function to add the additional variables:

do_deploy_append() {
echo "hdmi_force_hotplug=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "hdmi_group=2" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "hdmi_mode=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "hdmi_mode=87" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "hdmi_cvt 800 480 60 6 0 0 0" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "max_usb_current=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
}
zabumba
  • 257
  • 1
  • 7
  • 20
0

Just a small note (although the thread is very old):

Nowadays, the user can provide extra parameters via the RPI_EXTRA_CONFIG variable.

For this, the rpi-config_git.bb recipe contains the following code:

# Append extra config if the user has provided any
printf "${RPI_EXTRA_CONFIG}\n" >> $CONFIG
Arno
  • 1
  • 1