Hi,
After checking HardKernel’s Ubuntu Mate, I’ve decided I needed a smaller distro (using 16GB eMMC), enter DietPi.
I probably missed something during installation after flashing DietPi_OdroidC4-ARMv8-Buster to eMMC. I need to enable lineout overlay (second soundcard J4-header on Odroid C4) but config.ini is nowhere to be found, should be in the same dir as boot.ini. Overlay dir with *.dtb and *.dts files is present.
I added deb http://deb.odroid.in/c4/ focal main in /etc/apt/source.list and a missing KEY (NO_PUBKEY error, fixed with sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2DD567ECD986B59D) followed by apt update && apt full-upgrade and a reboot but still no config.ini file
Thanks for the replay.
As stated above config.ini is missing, creating this file and adding only Device Tree Overlay did not work (I’ve already tried it when overlay wasn’t working on Ubuntu). Copying /boot/config.ini from a working Ubuntu-minimal backup image also does nothing, aplay -l returns only card 0: ODROIDHDMI.
config.ini file content:
[generic]
; *************************************************
; Copy of a working Ubuntu minimal /boot/config.ini
; *************************************************
; Auto Detection of Monitor settings based on your Screen information
display_autodetect=true
; HDMI Mode
; Resolution Configuration
; Symbol | Resolution
; ----------------------+-------------
; "480x272p60hz" | 480x272 Progressive 60Hz
; "480x320p60hz" | 480x320 Progressive 60Hz
; "480p60hz" | 720x480 Progressive 60Hz
; "576p50hz" | 720x576 Progressive 50Hz
; "720p60hz" | 1280x720 Progressive 60Hz
; "720p50hz" | 1280x720 Progressive 50Hz
; "1080p60hz" | 1920x1080 Progressive 60Hz
; "1080p50hz" | 1920x1080 Progressive 50Hz
; "1080p30hz" | 1920x1080 Progressive 30Hz
; "1080p24hz" | 1920x1080 Progressive 24Hz
; "1080i60hz" | 1920x1080 Interlaced 60Hz
; "1080i50hz" | 1920x1080 Interlaced 50Hz
; "2160p60hz" | 3840x2160 Progressive 60Hz
; "2160p50hz" | 3840x2160 Progressive 50Hz
; "2160p30hz" | 3840x2160 Progressive 30Hz
; "2160p25hz" | 3840x2160 Progressive 25Hz
; "2160p24hz" | 3840x2160 Progressive 24Hz
; "smpte24hz" | 3840x2160 Progressive 24Hz SMPTE
; "2160p60hz420" | 3840x2160 Progressive 60Hz YCbCr 4:2:0
; "2160p50hz420" | 3840x2160 Progressive 50Hz YCbCr 4:2:0
; "640x480p60hz" | 640x480 Progressive 60Hz
; "800x480p60hz" | 800x480 Progressive 60Hz
; "800x600p60hz" | 800x600 Progressive 60Hz
; "1024x600p60hz" | 1024x600 Progressive 60Hz
; "1024x768p60hz" | 1024x768 Progressive 60Hz
; "1280x800p60hz" | 1280x800 Progressive 60Hz
; "1280x1024p60hz" | 1280x1024 Progressive 60Hz
; "1360x768p60hz" | 1360x768 Progressive 60Hz
; "1440x900p60hz" | 1440x900 Progressive 60Hz
; "1600x900p60hz" | 1600x900 Progressive 60Hz
; "1600x1200p60hz" | 1600x1200 Progressive 60Hz
; "1680x1050p60hz" | 1680x1050 Progressive 60Hz
; "1920x1200p60hz" | 1920x1200 Progressive 60Hz
; "2560x1080p60hz" | 2560x1080 Progressive 60Hz
; "2560x1440p60hz" | 2560x1440 Progressive 60Hz
; "2560x1600p60hz" | 2560x1600 Progressive 60Hz
; "3440x1440p60hz" | 3440x1440 Progressive 60Hz
hdmimode=1080p60hz
; Monitor output
; Controls if HDMI PHY should output anything to the monitor
monitor_onoff=false
; Overscan percentage
; This value scales down the actual screen size by the percentage below
; valid range is 80 to 100
overscan=100
; SDR/HDR Configuration
; This forces SDR or HDR modes
; valid options are: sdr hdr auto
sdrmode=auto
; voutmode : hdmi or dvi
; hdmi / dvi
voutmode=hdmi
; HPD enable/disable option
; false / true
disablehpd=false
; Enable/Disable CEC
cec=true
; Hardkernel ODROID-VU7 support
; By default VU7 support is disabled
disable_vu7=true
; Maximum CPU frequency
; 100/250/500/667/1000/1200/1404/1500/1608/1704/1800/1908 (stock)/2016/2100
; max_freq_a55=1800
; Maximum number of CPU cores
maxcpus=4
; Wake-On-Lan support (0=disable, 1=enable)
; enable_wol=1
; Device Tree Overlay
overlay_resize=16384
overlay_profile=lineout
overlays="spi0 i2c0 i2c1 uart0"
[overlay_custom]
overlays="i2c0 i2c1"
[overlay_hktft32]
overlays="hktft32"
[overlay_hktft35]
overlays="hktft35"
[overlay_lineout]
overlays="lineout"
For now I2C also is not working but this should be resolved when overlay works (ls /dev/i2c* → No such file or directory).
I probably could force something like I2C to work with:
root@odroid:~# fdtput -t s /boot/meson64_odroidc4.dtb /soc/cbus@ffd00000/i2c@1d000 status okay
But this defeats the purpose of overlays plus I have no idea what to fdtput to enable lineout.
I just found that indeed the default boot.ini on Odroid C4 (same as N2) does not yet incorporate the dtoverlays nicely. Will be done for next DietPi release. Good that you already found the command to do that manually for now, we’ll implement it a way that you can add overlays via simple dtoverlay= (or similar) setting in boot.ini and add some of them via dietpi-config, e.g. toggle for I2C and SPI and probably a few others where applicable.
Just did some reverse engineering on the original hardkernel ubuntu image and copied the following lines (from boot.ini and config.ini) to /boot/boot.ini (this color + adapted the path to the overlay files (this color):
# Set load addresses
setenv dtb_loadaddr "0x1000000"
setenv k_addr "0x1100000"
setenv loadaddr "0x1B00000"
setenv initrd_loadaddr "0x3700000"
setenv dtbo_addr_r "0x11000000"
# Device Tree Overlay
overlay_resize=16384
overlay_profile=
overlays="spi0 i2c0 i2c1 uart0"
# Load kernel, dtb and initrd
fatload mmc ${devno}:1 ${k_addr} Image.gz
fatload mmc ${devno}:1 ${dtb_loadaddr} meson64_odroidn2.dtb
fatload mmc ${devno}:1 ${initrd_loadaddr} uInitrd
fdt addr ${dtb_loadaddr}
if test "x{overlays}" != "x"; then
fdt resize ${overlay_resize}
for overlay in ${overlays}; do
load mmc ${devno}:1 ${dtbo_addr_r} overlays/odroidn2/${overlay}.dtbo \
&& fdt apply ${dtbo_addr_r}
done
fi
# unzip the kernel
unzip ${k_addr} ${loadaddr}
# boot
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
\
\
This patch seems to work fine. But I think, there needs to be a little more for a proper implementation “in the DietPi way”
That looks actually pretty fine. I’m just not sure if this memory address is common, it looks too large, actually .
But otherwise, resizing the device tree, looping through the device-specific overlay dir and loading what has been added to the config file looks fine. I like the check if there is any overlay defined, before resizing the device tree. E.g. Armbian resizes it regardless if the variable is empty or not. I’m not sure if this causes additional RAM usage, but at least it is an unnecessary step in that case.
I did the update and my installation is at version 6.34.3, but the files at the boot partition don’t seem to got updated. At least I couldn’t find the code you’ve mentioned (it’s expected to be in boot.ini, right?) and the latest entry in /boot/dietpi-CHANGELOG.txt is for version 6.28.
Is there anything else I might have missed to proceed besides running dietpi-update in order to get the files of the boot partition updated as well?
Ah sorry, I mixed it up with the threads name that it was Odroid C4. Indeed the N2 doesn’t have it yet. But good about it is that your method is then very close to what the N2 will get from Meverics pre-images side. We’ll probably create very own boot.ini/boot.cmd configs. I think those overlay_profile stuff is actually not required if one can add the exact required overlays to a custom list instead, so I like your slimmer implementation more.