Config.txt overwritten and dt-blob.bin ignored

I’m currently trying to set up a Compute Module on a custom PCB and am having some trouble with the config.txt / dt-blob.bin setup. I have a config.txt and dt-blob.bin that has worked perfectly in the raspbian OS, but am having troubles using it on resinOS.

I’ve tried a few ways of doing the config.txt:

  1. Creating RESIN_HOST_CONFIG_ entries through the dashboard. This method works, and I’m able to enable i2c as I wish and communicate over it. The problem is that it has to be enabled through a dtoverlay=, and so does the uart’s on my device, so I can’t user the RESIN_HOST_CONFIG_ if I want to use more than one interface at a time - which is what I need.

  2. Mounting the eMMC of the Compute Module (On MacOS and Windows) and adding/replacing the config.txt that is located on the /resin-boot partition that shows up when this is done. When this is done, the config.txt that I load is replaced again by the one that I’m assuming the RESIN_HOST_CONFIG defines. I tested by setting the gpu_mem value and could see that that’s what was replacing it, leaving a config.txt with just gpu_mem=124 on the mounted partition.

  3. Editing the files located on both /resin-boot or /mnt/boot/ through the Host SSH session on the dashboard, adding the lines by copying them from the working config.txt from raspbian. The /resin-boot/config.txt seems to be ignored, the /mnt/boot/config.txt get’s overwritten as in 2.

When booting up the device, I notice that in the logs, the service starts, but then after a little time the text below is printed to the logs and the device reboots (At which point I guess the config.txt is cleared):
28.02.18 08:08:42 (+0200) Applying boot config: {}
28.02.18 08:08:42 (+0200) Applied boot config: {}

With regard to the dt-blob.bin, I’ve tried copying it at the same time as the config.txt in 2. above, but it doesn’t seem to be working as I can see that the pin defaults that I set in the file aren’t applied after boot.

Any help in this regard would be greatly appreciated.

Thanks

Ok, I see through some more reading that I’m able to define multiple dtparams/dtoverlays using:

RESIN_HOST_CONFIG_dtoverlay=“overlay1contents”,“overlay2contents”
RESIN_HOST_CONFIG_dtparam=“param1contents”,“param2contents”

So that means I can fully define my config.txt through the web interface.

What remains now is the dt-blob.bin being ignored.

To anyone :
Should I understand that the only way to modify the config.txt in a Raspberry compute module is creating RESIN_HOST_CONFIG_ entries through the Dashboard ?

What is the proper way to add custom a dt-blob.bin ?

Any comment is appreciated it.

@rlev you would unfortunately need to add the file manually in the boot partition (the first partition of the image)

Hey @rlev to answer your first question you can also edit config.txt manually (before the first boot) have a look at https://www.balena.io/docs/reference/OS/advanced/#modifying-configtxt-locally-before-the-first-boot for more info

Thanks @nazrhom and @floion.

I will try both suggestions.

@nazrhom, @floion

I using a Raspberry CM3 Plus module and as a carrier board I use the CM3IO Board.

To add WiFi and Bluetooth we are using a WiFi/BT CYW43455 module which uses SDIO to communicate with the Raspberry CM3 module.
I tested this (CM3 module + Carrier board CM3IO) hardware using Raspian as main OS.
In order to enable the SDIO interface we used overlays.
I added this line to the “config.txt” file :

dtoverlay=sdio,poll_once=off,sdio_overclock=25,gpios_34_39

This will set pins 34-39 to be used as SDIO interfaces and the WiFi module will be recognized by the CM3 module.

I have attempted to do the same running BalenaOS_2.43.0_rev1 development version for Raspberry Pi 3 B/B+.

After flashing BalenaOS in the CM3 module and registering my device in balenaCloud I have added the custom variable RESIN_HOST_CONFIG_dtoverlay with the "sdio,poll_once=off","sdio_overclock=25","gpios_34_39" value.

After the board reboots the balenaCloud log shows that the dtoverlay is indeed applied but the CM3 module does not detect the wifi module using the sdio interface.

I have logged into the HOST using the balenaCloud terminal and the “dmesg” command show that no sdio interface is recognized.

Basically I would like to know .
How I can recreate the Raspian settings in a BalenaOS Host?

Any help is highly appreciated it.

Thanks

ps: In order for the CM3 board to be able to connect to balenaCloud I have used a usb-to-Ethernet adapter since the WiFi module is not recognized.

Can you paste the contents of the /mnt/boot/config.txt file when you are running from your cm3 board? Would like to check if they got applied correctly

@floion,

Before any custom variable using balenaCloud Dashboard is created in the device.

 root@ee9dba3:~# cat /mnt/boot/config.txt
....
....
## pwr_led_gpio
##     Set which GPIO to use for the PWR LED
##
##     In case you want to connect it to an external device
##
##     Not available on Model A/B boards.
##
##     Default 35.
##
#dtparam=pwr_led_gpio=35
# Enable UART
enable_uart=1

dtparam=i2c_arm=on
dtparam=spi=on
disable_splash=1
dtparam=audio=on

After the RESIN_HOST_CONFIG_dtoverlay is created using the Dashboard

root@ee9dba3:~# cat /mnt/boot/config.txt 
disable_splash=1
dtoverlay=sdio
dtoverlay=poll_once=off
dtoverlay=sdio_overclock=25
dtoverlay=gpios_34_39
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on
enable_uart=1
gpu_mem=16


root@ee9dba3:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.71 (oe-user@oe-host) (gcc version 8.3.0 (GCC)) #1 SMP Tue Sep 17 04:58:50 UTC 2019
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Compute Module 3 Plus Rev 1.0
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 8 MiB at 0x3dc00000
[    0.000000] On node 0 totalpages: 255488
[    0.000000]   Normal zone: 2246 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 255488 pages, LIFO batch:63
[    0.000000] random: get_random_bytes called from start_kernel+0xb0/0x4b4 with crng_init=0
[    0.000000] percpu: Embedded 17 pages/cpu s39564 r8192 d21876 u69632
[    0.000000] pcpu-alloc: s39564 r8192 d21876 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 253242
[    0.000000] Kernel command line: coherent_pool=1M bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:67:C1:46 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000  dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 rootfstype=ext4 rootwait root=PARTUUID=b8a83ef0-02 rootwait
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 983644K/1021952K available (8192K kernel code, 655K rwdata, 2328K rodata, 7168K init, 828K bss, 30116K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xbe800000 - 0xff800000   (1040 MB)
                   lowmem  : 0x80000000 - 0xbe600000   ( 998 MB)
                   modules : 0x7f000000 - 0x80000000   (  16 MB)
                     .text : 0x(ptrval) - 0x(ptrval)   (9184 kB)
                     .init : 0x(ptrval) - 0x(ptrval)   (7168 kB)
                     .data : 0x(ptrval) - 0x(ptrval)   ( 656 kB)
                      .bss : 0x(ptrval) - 0x(ptrval)   ( 829 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 28729 entries in 85 pages
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000022] Switching to timer-based delay loop, resolution 52ns
[    0.000269] Console: colour dummy device 80x30
[    0.000898] console [tty1] enabled
[    0.000954] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001000] pid_max: default: 32768 minimum: 301
[    0.001364] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001399] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002336] CPU: Testing write buffer coherency: ok
[    0.002811] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003481] Setting up static identity map for 0x100000 - 0x10003c
[    0.003647] rcu: Hierarchical SRCU implementation.
[    0.004457] smp: Bringing up secondary CPUs ...
[    0.005306] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.006226] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.007082] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.007204] smp: Brought up 1 node, 4 CPUs
[    0.007285] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.007309] CPU: All CPU(s) started in HYP mode.
[    0.007330] CPU: Virtualization extensions available.
[    0.008345] devtmpfs: initialized
[    0.020936] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.021204] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.021253] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.021873] pinctrl core: initialized pinctrl subsystem
[    0.022746] NET: Registered protocol family 16
[    0.025694] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.031316] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.031351] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.031569] Serial: AMBA PL011 UART driver
[    0.033862] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.068944] bcm2835-dma 3f007000.dma: DMA legacy API manager at (ptrval), dmachans=0x1
[    0.070659] SCSI subsystem initialized
[    0.070901] usbcore: registered new interface driver usbfs
[    0.070976] usbcore: registered new interface driver hub
[    0.071091] usbcore: registered new device driver usb
[    0.090112] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-08-28 15:08, variant start_cd
[    0.100364] raspberrypi-firmware soc:firmware: Firmware hash is 31098ceed842ca10c8ffd02ffe3640bf6c0190b4
[    0.111721] clocksource: Switched to clocksource arch_sys_counter
[    0.203418] VFS: Disk quotas dquot_6.6.0
[    0.203539] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.203750] FS-Cache: Loaded
[    0.203979] CacheFiles: Loaded
[    0.214002] NET: Registered protocol family 2
[    0.214784] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[    0.214850] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.214980] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.215184] TCP: Hash tables configured (established 8192 bind 8192)
[    0.215339] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.215404] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.215736] NET: Registered protocol family 1
[    0.216336] RPC: Registered named UNIX socket transport module.
[    0.216363] RPC: Registered udp transport module.
[    0.216385] RPC: Registered tcp transport module.
[    0.216406] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.277353] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.280411] Initialise system trusted keyrings
[    0.280654] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.290153] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.290207] FS-Cache: Netfs 'nfs' registered for caching
[    0.290784] NFS: Registering the id_resolver key type
[    0.290835] Key type id_resolver registered
[    0.290856] Key type id_legacy registered
[    0.290887] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.292790] aufs 4.19.17+-20190211
[    0.294276] Key type asymmetric registered
[    0.294303] Asymmetric key parser 'x509' registered
[    0.294375] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.294543] io scheduler noop registered
[    0.294567] io scheduler deadline registered
[    0.294760] io scheduler cfq registered (default)
[    0.294786] io scheduler mq-deadline registered
[    0.294808] io scheduler kyber registered
[    0.298040] bcm2708_fb soc:fb: FB found 1 display(s)
[    0.306957] Console: switching to colour frame buffer device 82x26
[    0.314941] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416
[    0.322634] bcm2835-rng 3f104000.rng: hwrng registered
[    0.325877] vc-mem: phys_addr:0x00000000 mem_base=0x3f000000 mem_size:0x3f600000(1014 MiB)
[    0.332227] vc-sm: Videocore shared memory driver
[    0.335462] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    0.351971] brd: module loaded
[    0.364867] loop: module loaded
[    0.368331] Loading iSCSI transport class v2.0-870.
[    0.371995] libphy: Fixed MDIO Bus: probed
[    0.374952] tun: Universal TUN/TAP device driver, 1.6
[    0.378046] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.381169] dwc_otg 3f980000.usb: base=(ptrval)
[    0.584331] Core Release: 2.80a
[    0.587209] Setting default values for core params
[    0.590085] Finished setting default values for core params
[    0.793232] Using Buffer DMA mode
[    0.796031] Periodic Transfer Interrupt Enhancement - disabled
[    0.798952] Multiprocessor Interrupt Enhancement - disabled
[    0.801942] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.804947] Dedicated Tx FIFOs mode
[    0.808390] WARN::dwc_otg_hcd_init:1045: FIQ DMA bounce buffers: virt = bdd04000 dma = 0xfdd04000 len=9024
[    0.814616] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    0.829203] dwc_otg: Microframe scheduler enabled
[    0.829262] WARN::hcd_init_fiq:457: FIQ on core 1
[    0.832081] WARN::hcd_init_fiq:458: FIQ ASM at 80682390 length 36
[    0.834845] WARN::hcd_init_fiq:497: MPHI regs_base at be810000
[    0.837517] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.840238] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.843083] dwc_otg 3f980000.usb: irq 56, io mem 0x00000000
[    0.845892] Init: Port Power? op_state=1
[    0.848628] Init: Power Port (0)
[    0.851549] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    0.857108] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.860069] usb usb1: Product: DWC OTG Controller
[    0.863024] usb usb1: Manufacturer: Linux 4.19.71 dwc_otg_hcd
[    0.865969] usb usb1: SerialNumber: 3f980000.usb
[    0.869433] hub 1-0:1.0: USB hub found
[    0.872343] hub 1-0:1.0: 1 port detected
[    0.875681] dwc_otg: FIQ enabled
[    0.875687] dwc_otg: NAK holdoff enabled
[    0.875693] dwc_otg: FIQ split-transaction FSM enabled
[    0.875705] Module dwc_common_port init
[    0.875970] usbcore: registered new interface driver usb-storage
[    0.879002] mousedev: PS/2 mouse device common for all mice
[    0.882737] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    0.885834] bcm2835-cpufreq: min=600000 max=1200000
[    0.889210] sdhci: Secure Digital Host Controller Interface driver
[    0.892062] sdhci: Copyright(c) Pierre Ossman
[    0.894022] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.895708] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    0.897289] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.899068] ledtrig-cpu: registered to indicate activity on CPUs
[    0.900635] hidraw: raw HID events driver (C) Jiri Kosina
[    0.902286] usbcore: registered new interface driver usbhid
[    0.903843] usbhid: USB HID core driver
[    0.905809] vchiq: vchiq_init_state: slot_zero = (ptrval), is_master = 0
[    0.908372] [vc_sm_connected_init]: start
[    0.911231] vc_vchi_sm_init: failed to open VCHI service (-1)
[    0.911235] [vc_sm_connected_init]: failed to initialize shared memory service
[    0.914497] [vc_sm_connected_init]: end - returning -1
[    0.917527] Initializing XFRM netlink socket
[    0.919490] NET: Registered protocol family 10
[    0.921659] Segment Routing with IPv6
[    0.923227] NET: Registered protocol family 17
[    0.924738] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.927902] Key type dns_resolver registered
[    0.929745] Registering SWP/SWPB emulation handler
[    0.931718] registered taskstats version 1
[    0.933290] Loading compiled-in X.509 certificates
[    0.938832] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    0.940482] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    1.967856] console [ttyAMA0] enabled
[    1.974170] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    1.981575] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    2.014552] sdhost: log_buf @ (ptrval) (fdd07000)
[    2.069407] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    2.077506] of_cfs_init
[    2.083119] of_cfs_init: OK
[    2.089269] uart-pl011 3f201000.serial: no DMA platform data
[    2.096921] Indeed it is in host mode hprt0 = 00021501
[    2.170694] Freeing unused kernel memory: 7168K
[    2.178824] Run /init as init process
[    2.189658] random: fast init done
[    2.213320] mmc0: new high speed MMC card at address 0001
[    2.221108] mmcblk0: mmc0:0001 BJTD4R 29.1 GiB
[    2.227745] mmcblk0boot0: mmc0:0001 BJTD4R partition 1 4.00 MiB
[    2.235785] mmcblk0boot1: mmc0:0001 BJTD4R partition 2 4.00 MiB
[    2.243597] mmcblk0rpmb: mmc0:0001 BJTD4R partition 3 4.00 MiB, chardev (246:0)
[    2.257178]  mmcblk0: p1 p2 p3 p4 < p5 p6 >
[    2.311786] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.320386] Indeed it is in host mode hprt0 = 00001101
[    2.564247] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice= 6.54
[    2.575688] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.584605] usb 1-1: Product: USB2.1 Hub
[    2.589992] usb 1-1: Manufacturer: GenesysLogic
[    2.596568] hub 1-1:1.0: USB hub found
[    2.602155] hub 1-1:1.0: 4 ports detected
[    2.941786] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.049576] CP437: Invalid argument
[    3.114801] usb 1-1.1: New USB device found, idVendor=0b95, idProduct=7720, bcdDevice= 0.01
[    3.129143] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.139691] usb 1-1.1: Product: AX88772A
[    3.144576] fsck.fat 4.1 (2017-01-24)
               /dev/disk/by-label/resin-boot: 153 files, 16363/80628 clusters
[    3.146771] usb 1-1.1: Manufacturer: ASIX Elec. Corp.
[    3.171860] usb 1-1.1: SerialNumber: 00081A
[    3.181968] resin-rootA: clean, 5927/39936 files, 223157/319488 blocks

[    3.203785] resin-rootB: clean, 11/39936 files, 15349/319488 blocks

[    3.258999] resin-state: clean, 59/5136 files, 1895/20480 blocks

[    3.581101]  mmcblk0: p1 p2 p3 p4 < p5 p6 >
[    4.686605] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.718184] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    5.122386] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    5.137198] aufs au_opts_verify:1609:init[1]: dirperm1 breaks the protection by the permission bits on the lower branch
[    5.503605] systemd[1]: System time before build time, advancing clock.
[    5.529495] systemd[1]: systemd 241-9-gc1f8ff8+ running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[    5.559577] systemd[1]: Detected architecture arm.
[    5.601977] systemd[1]: No hostname configured.
[    5.608283] systemd[1]: Set hostname to <localhost>.
[    5.624523] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
[    5.634470] systemd[1]: Hardware watchdog 'Broadcom BCM2835 Watchdog timer', version 0
[    5.645926] systemd[1]: Set hardware watchdog to 10s.
[    5.718586] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    5.741357] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    5.926544] systemd[1]: /lib/systemd/system/chronyd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/chrony/chronyd.pid \xe2\x86\x92 /run/chrony/chronyd.pid; please update the unit file accordingly.
[    6.072124] random: systemd: uninitialized urandom read (16 bytes read)
[    6.080775] random: systemd: uninitialized urandom read (16 bytes read)
[    6.102155] random: systemd: uninitialized urandom read (16 bytes read)
[    8.138096] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
[   10.253257] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[   10.272641] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[   10.282770] [vc_sm_connected_init]: start
[   10.289125] vc_sm_cma_vchi_init: failed to open VCHI service (-1)
[   10.289133] [vc_sm_connected_init]: failed to initialize shared memory service
[   10.328157] media: Linux media interface: v0.10
[   10.367952] videodev: Linux video capture interface: v2.00
[   10.389596] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[   10.422389] bcm2835_audio soc:audio: card created with 8 channels
[   10.429453] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   10.434365] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   10.482440] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[   10.501876] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[   10.516642] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[   10.533719] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[   10.860410] asix 1-1.1:1.0 eth0: register 'asix' at usb-3f980000.usb-1.1, ASIX AX88772 USB 2.0 Ethernet, 00:0e:c6:53:36:d7
[   10.876458] usbcore: registered new interface driver asix
[   14.515615] i2c /dev entries driver
[   14.758165] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   14.792994] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   14.802092] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   14.814921] cfg80211: failed to load regulatory.db
[   15.256206] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.265163] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.397667] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.408914] asix 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[   82.439568] random: crng init done
[   82.442991] random: 7 urandom warning(s) missed due to ratelimiting
[   83.049709] Bridge firewalling registered
[   83.600967] IPv6: ADDRCONF(NETDEV_UP): supervisor0: link is not ready
[   83.794696] IPv6: ADDRCONF(NETDEV_UP): balena0: link is not ready
[   84.001808] IPv6: ADDRCONF(NETDEV_UP): br-f3f7664da110: link is not ready

Look like the overlay was applied. However the dmesg command does not show a new sdio interface being detected :frowning:

Using Raspian I see someting like mmc1: new high speed MMC card at address which indicates the CM3 OS detected a new sdio high speed interface.

I will re-check the wiring to discard hardware problems.

Any hints?

Thank you.

Hi, as said here https://www.balena.io/docs/reference/OS/advanced/#setting-device-tree-overlays-dtoverlay-and-parameters-dtparam you should actually set the dtoverlay in the following way:

sdio,poll_once=off,sdio_overclock=25,gpios_34_39

So do not use any quotes. As the documentation I pasted above says: if it doesn’t begin with a quote ", the value will be parsed as a single string and not split into several lines. And that is how you need it to be, all in 1 line. Please try that and let us know how that goes.

@floion,

After applied the custom variable in 1 line with no quotes I get :
root@583aff1:~# dmesg | grep -i mmc1
[ 2.058766] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 2.067353] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.171929] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.181629] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.199093] mmc1: queuing unknown CIS tuple 0x80 (6 bytes)
[ 2.393351] mmc1: new high speed SDIO card at address 0001

            root@583aff1:~# dmesg | grep -i brcmfmac
            [   10.638018] brcmfmac: F1 signature read @0x18000000=0x15264345
            [   10.639074] brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported
            [   10.651146] brcmfmac: brcmf_sdio_probe_attach: brcmf_chip_attach failed!
            [   10.660049] brcmfmac: brcmf_sdio_probe: brcmf_sdio_probe_attach failed
            [   10.669222] brcmfmac: brcmf_ops_sdio_probe: F2 error, probe failed -19...
            [   10.678508] usbcore: registered new interface driver brcmfmac

mmc1 is detected as a new sdio interface.
I have some problems with signal integrity that prevents the wifi module to be recognize and configure properly.
I will check this hardware issue and will let you know how goes.

Thank you very much for your help.

sdio,poll_once=off,sdio_overclock=25,gpios_34_39

@floion
We are planning using UART0 on pins 30 to pin 33 ( tx,rx,cts,rts) for the Bluetooth interface.
How to use the other Uart1 on pins 40 (TXD) and pin 41(RXD) at the user space?

Thanks

About getting bluetooth to work see https://www.raspberrypi.org/forums/viewtopic.php?t=245225
There are instructions there on how to create the required overlay to get UART working like you need it to.

@floion
I have tried to add a new custom variable to my device
RESIN_HOST_CONFIG_dtoverlay = uart1,txd1_pin=40,rxd1_pin=41
But when I press submit an error message that said “variable exist already” shows up.

If I already have
RESIN_HOST_CONFIG_dtoverlay = sdio,poll_once=off","sdio_overclock=25","gpios_34_39

How to add another overlay?

Thanks

I think you can merge them into just one variable only, something like

RESIN_HOST_CONFIG_dtoverlay = "sdio,poll_once=off","sdio_overclock=25","gpios_34_39","uart1","txd1_pin=40","rxd1_pin=41"

More details can be found in our docs here https://www.balena.io/docs/reference/OS/advanced/#setting-device-tree-overlays-dtoverlay-and-parameters-dtparam

You should add them like this:

RESIN_HOST_CONFIG_dtoverlay = “sdio,poll_once=off,sdio_overclock=25,gpios_34_39”,“uart1,txd1_pin=40,rxd1_pin=41”

@floion

Will try thank you.

Turn out I need to add a lot of changes to the config.txt in order to make a display and uart1 work.

dtparam=i2c_arm=on
dtparam=spi=off

#display dpi24
ignore_lcd=1
lcd_rotate=2
dtoverlay=dpi24
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=640
framebuffer_height=360
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87

dpi_output_format=0xfff007

dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 3

#I2C FOR TOUCH
#gpio=0,1=ip
gpio=28,29=a0
#DPI
gpio=0,1=a2		
gpio=4-27=a2
#UART1 FOR BT
gpio=40-41=a5
#SDIO FOR WIFI
gpio=34-39=a3
#UART0 FOR MCU
gpio=32-33=a3
gpio=30,31=op
#PWM FOR ADJ
gpio=45=a0
#Touch INT/RST
gpio=2,3=ip


# Uncomment some or all of these to enable the optional hardware interfaces
dtoverlay=midi-uart1
dtoverlay=uart1,txd1_pin=40
dtoverlay=uart1,rxd1_pin=41

dtoverlay=i2c0-bcm2708,pins_28_29
dtparam=i2c_vc=on
dtparam=uart0_arm=on
dtparam=uart1_arm=on
dtparam=sdio1_arm=on
dtparam=pwm1_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

#scaling_kernel=8
start_x=0
gpu_mem=256
##disable_camera_led=1
enable_uart=1

As far as I know this can be done :
1- Using BalenaCloud Dashboard and using RESIN_HOST_CONFIG_dtoverlay and RESIN_HOST_CONFIG_dtparamvariables.
2- Trying to mount and modify the config.txt in the sd card before first boot of the device.
3- Not sure but I think also should be possible to build a new image from the repo source with a custom config.txt?

Option 1 is okay for small change but I have several changes.
Option 2 might work or not. I know sometimes the supervisor write changes back to whatever was back before.
Option 3 looks like should work. But where in the repo structure the changes to obtain a custom config.txt has to be made?

Thanks

Glad you managed to get it working! Please let us know if there’s anything else you need help with.