Custom device tree with TorizonCore Builder

Hi,
I’m trying to build my own TorizonCore image with a modified device tree.
I’m using a Apalis imx8qm on a apalis evaluation board. I’ve added this part to my tcbuild.yml file:

customization:
device-tree:
include-dirs:
- device-trees/include/
custom: device-trees/dts-arm64/imx8qm-apalis-eval.dts

Before I enabled the customization part the image build fine and I could run it on my board. But when I added this part I got some troubles.
I can build the image and I can install it on my module using the Toradex Easy Installer, but when I reboot the device I can’t get an ssh connection anymore.

I haven’t made any other changes, just added these lines but they should work right?

My idea was to replace the dtsi files in the device-trees/dts-arm64 folder with my customized files and build an image, but I can’t even make the image work with the defualt files.

Best regards,
Pontus

Hi @pontusoim,

How are you? Could you please share with us more information on the topic?

  • Which Apalis version are you using?
  • Which TorizonCore version are you trying to build?
  • Which TorizonCore Builder version are you using?

Also, could you please share with us your full tcbuild.yml and the device tree files you’re using? You could use share.toradex.com to do so and send the link here or by a private message if you feel more comfortable.

Best regards,

Hi,
I’m using the Apalis iMX8QM 4GB WB IT V1.1 C
I’m using the torizon-core-docker-apalis-imx8-Tezi_5.6.0+build.13.tar image
And I’m using torizoncore-builder 3.5.1

My tcbuild.yml looks like this:

input:
  easy-installer:
    local: torizon-core-docker-apalis-imx8-Tezi_5.6.0+build.13.tar
customization:
  device-tree:
    include-dirs:
      - device-trees/include/
    custom: device-trees/dts-arm64/imx8qm-apalis-v1.1-eval.dts
output:
    local: my_image
    name: "My customized image"
    bundle:
      dir: bundle/

I got it to run now but I still have a problem. My docker compose file starts two containers, one is the Weston container that I just copied from the docker-compose file you get when you build the image with evaluation containers, and another container that runs my application. When it starts the weston container exits straight after it starts, so I can’t see anything on my connected screen. I have only added the custom: device-trees/dts-arm64/imx8qm-apalis-v1.1-eval.dts line, I haven’t changed any dtsi files or anything like that. If I remove that line from the tcbuild file the weston container runs fine.

Can you help me to figure out why that device tree kills my weston container?

This is the log from the weston container after it exits:


SoC is: 'i.MX8QM'                                                                                                                     
SoC has GPU: true                                                                                                                     
SoC has DPU: true                                                                                                                     
g2d implementation: dpu                                                                                                               
update-alternatives: using /usr/lib/aarch64-linux-gnu/libg2d-dpu.so to provide /usr/lib/aarch64-linux-gnu/libg2d.so.1.5 (libg2d.so.1.5
) in manual mode                                                                                                                      
update-alternatives: using /opt/g2d_dpu_samples to provide /opt/g2d_samples (g2d_samples) in manual mode                              
NXP EULA has already been accepted.                                                                                                   
touch: cannot touch '/tmp/nxp-eula-accepted': Permission denied                                                                       
touch: cannot touch '/tmp/nxp-eula-accepted': Permission denied                                                                       
Date: 2022-06-23 UTC                                                                                                                  
[09:05:33.137] weston 8.0.0                                                                                                           
               https://wayland.freedesktop.org                                                                                        
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/                                                  
               Build: upstream/8.0.0-imx.5.4.24-3-gbc62283                                                                            
[09:05:33.137] Command line: /usr/bin/weston --current-mode                                                                           
[09:05:33.137] OS: Linux, 5.4.161-5.6.0+git.0f0011824921, #1-TorizonCore SMP PREEMPT Fri Mar 25 14:27:29 UTC 2022, aarch64            
Date: 2022-06-23 UTC                                                                                                                  
[09:05:33.137] weston 8.0.0                                                                                                           
               https://wayland.freedesktop.org                                                                                        
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/                                                  
               Build: upstream/8.0.0-imx.5.4.24-3-gbc62283                                                                            
[09:05:33.137] Command line: /usr/bin/weston --current-mode                                                                           
[09:05:33.137] OS: Linux, 5.4.161-5.6.0+git.0f0011824921, #1-TorizonCore SMP PREEMPT Fri Mar 25 14:27:29 UTC 2022, aarch64            
[09:05:33.139] Using config file '/etc/xdg/weston/weston.ini'                                                                         
[09:05:33.139] Using config file '/etc/xdg/weston/weston.ini'                                                                         
[09:05:33.140] Output repaint window is 16 ms maximum.                                                                                
[09:05:33.141] Loading module '/usr/lib/aarch64-linux-gnu/libweston-8/drm-backend.so'                                                 
[09:05:33.140] Output repaint window is 16 ms maximum.                                                                                
[09:05:33.141] Loading module '/usr/lib/aarch64-linux-gnu/libweston-8/drm-backend.so'                                                 
[09:05:33.157] initializing drm backend                                                                                               
[09:05:33.157] initializing drm backend                                                                                               
[09:05:33.233] logind: not running in a systemd session                                                                               
[09:05:33.234] logind: cannot setup systemd-logind helper (-61), using legacy fallback                                                
[09:05:33.233] logind: not running in a systemd session                                                                               
[09:05:33.234] logind: cannot setup systemd-logind helper (-61), using legacy fallback                                                
[09:05:33.236] no drm device found                                                                                                    
[09:05:33.236] no drm device found                                                                                                    
[09:05:33.236] fatal: failed to create compositor backend                                                                             
[09:05:33.236] fatal: failed to create compositor backend                                                                             
Internal warning: debug scope 'drm-backend' has not been destroyed. 
Internal warning: debug scope 'drm-backend' has not been destroyed.

Hopefully it can give some clues to why it exits.

/Pontus

Dear @pontusoim,

It seems that the drm device was not found. Could you please share with us the changes that you made to your device tree? You could use share.toradex.com. Also, are you using which kind of screen?

Have you enabled the proper overlays? Setting up Displays with Torizon | Toradex Developer Center

Best regards,

Hi, I’m his colleague who is taking over on the project.

I’ve shared the device tree files that we are using here: https://share.toradex.com/bp35nj012hozphu
And this is the screen we are using:
Elo_1903LM_DICOM_DS.pdf (178.9 KB)

It has worked previously with the device tree that we want but when we wanted to add an image that flashed the toradex automatically with an usb, it stopped working with the weston container.

Dear @edmirsuljicOIM,

Thanks for the files, we’re investigating what could have caused this behavior.

Could you please just tell me how you used to do this before? You send the device tree to the board after the image was installed? What were the commands used when it worked? It was that exact same device tree?

Best regards,

Thank you!

Yes we changed it after the image was installed. We ssh to the machine and remove the old files and add the new ones.

I dont remember the exact commands but I guess thats easy to figure out.

Edmir Suljic

Dear @edmirsuljicOIM,

On your tcbuild.yml it looks like there is no device tree overlay included. It seems that your display is connected through HDMI, right? If you look here: Setting up Displays with Torizon | Toradex Developer Center, on the Apalis iMX8, the HDMI overlay is enabled by default but when you made your custom TorizonCore Distribution you didn’t have it on the tcbuild. So if you change the device tree after an original image is installed, it will change the main device tree only and not the overlays. Could you please test with something like:

customization:
  device-tree:
    include-dirs:
      - device-trees/include/
    custom: device-trees/dts-arm64/imx8qm-apalis-v1.1-eval.dts
    overlays: 
      add:
        - device-trees/overlays/apalis-imx8_hdmi_overlay.dts

The example is adapted from here: TorizonCore Builder Tool “build” command | Toradex Developer Center while the overlay is here: device-trees/apalis-imx8_hdmi_overlay.dts at toradex_5.4-2.3.x-imx · toradex/device-trees · GitHub. However, you should have the overlay file available already if you did a torizoncore-builder dt checkout

Please tell me if this works.

Yep, this worked.
Thank you so much!