Led_output Cortex-m4

Hi @Mehrdad !

Thanks for the clarification.

Can you please share the output of sudo tdx-info --all on your module?

Best regards,

1 Like

Hi @henrique.tx ,
Please see the attached file the output summary.
device summary.txt (39.4 KB)

Best,
Mehrdad

Hi @Mehrdad !

Thanks for the file.

From that, we can see that you are still using the default (pre-enabled) device trees and your overlays are not enabled.

...
Device tree overlays
------------------------------------------------------------
Overlays enabled:         fdt_overlays=verdin-imx8mm_dsi-to-hdmi_overlay.dtbo verdin-imx8mm_spidev_overlay.dtbo
...

After you build the image, aren’t you installing it to the module?

Please check the deployment section of the Workflow article

Best regards,

1 Like

Hi @henrique.tx ,

If you’re asking about deployment, here’s what I did on Ubuntu.

The last command, from the output directory, shows that the image was successfully deployed to my SOM.

Best regards,
Mehrdad

Hi @Mehrdad !

Sorry. I forgot you shared it already.

Before I thought it was only the device tree overlays being enabled. But, as you noted, the pending state might be the issue that is causing your updates to not take place.

I will need to check if I can reproduce it, which could be a bug.

Could you please share the version of TorizonCore Builder that you are using?

Please share the output of

torizoncore-builder --version

and

docker images | grep torizoncore-builder

Best regards,

1 Like

Thank you so much @henrique.tx .

torizoncore-builder --version:  torizoncore-builder 3.7.0

and

docker images | grep torizoncore-builder:  torizon/torizoncore-builder                                                                                3
d67833aab937   3 months ago   958MB

Best regards,
Mehrdad

Hi @Mehrdad !

I just tested and I could not reproduce the strange behavior you are getting.

I used the same TorizonCore Builder version (same hash):

 $ docker images | rg torizoncore-builder
torizon/torizoncore-builder        3  d67833aab937   3 months ago    958MB

I used the following tcbuild.yaml:

input:
  easy-installer:
    local: torizon-core-docker-verdin-imx8mm-Tezi_6.2.0+build.2

customization:
  device-tree:
    include-dirs:
      - linux-toradex_5.15-2.1.x-imx/include/
      - linux-toradex_5.15-2.1.x-imx/arch/arm64/boot/dts/freescale
    overlays:
      clear: true
      add:
        - enable-led.dtso
output:
  easy-installer:
    local: output_directory

Notes:

Content of enable-led.dtso:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "imx8mm-pinfunc.h"

/ {
    compatible = "toradex,verdin-imx8mm";
};

&{/} {
    leds {
        compatible = "gpio-leds";

        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_my_led>;

        myled_sodimm_19 {
            label = "my_led_sodimm_19";
            gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "heartbeat";
            default-state = "on";
        };

        myled_sodimm_55 {
            label = "my_led_sodimm_55";
            gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "heartbeat";
            default-state = "on";
        };
    };
};

&pwm1 {
    status = "disabled";
};

&pwm2 {
    status = "disabled";
};

&iomuxc {
    /*pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
                <&pinctrl_gpio3>, <&pinctrl_gpio4>,
                <&pinctrl_gpio7>, <&pinctrl_gpio8>,
                <&pinctrl_gpio_hog1>, <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>,
                <&pinctrl_pmic_tpm_ena>, <&pinctrl_my_led>;*/
    pinctrl_my_led: myledgrp {
        fsl,pins =
            <MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1 0x104>, // SODIMM 19 // pull-down enabled and drive strength X2
            <MX8MM_IOMUXC_I2C2_SCL_GPIO5_IO16  0x104>; // SODIMM 55 // pull-down enabled and drive strength X2
    };
};

After using the build command, I unpacked the image from the output_directory and deployed it using torizoncore-builder just like you did;

torizoncore-builder build
Building image as per configuration file 'tcbuild.yaml'...

=>> Handling input section
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 8fcecdceae5e7e70f0d852eea6d97f940ea0196849d6461cbd665312ca43a3ba from local repository...
957 metadata, 9227 content objects imported; 579.3 MB content written
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 8fcecdceae5e7e70f0d852eea6d97f940ea0196849d6461cbd665312ca43a3ba
  TorizonCore Version: 6.2.0+build.2

=>> Handling customization section

=> Handling device-tree subsection
Not testing overlay because base image does not have a device-tree set!

=> Adding device-tree overlay 'enable-led.dtso'
'enable-led.dtso' compiles successfully.
Overlay enable-led.dtbo successfully applied.

=>> Handling output section
Applying changes from STORAGE/dt.
Commit 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f has been generated for changes and is ready to be deployed.
Deploying commit ref: tcbuilder-20230616081638
Pulling OSTree with ref tcbuilder-20230616081638 from local archive repository...
  Commit checksum: 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f
  TorizonCore Version: 6.2.0+build.2-tcbuilder.20230616081638
  Default kernel arguments: quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3

957 metadata, 9228 content objects imported; 579.3 MB content written
Pulling done.
Deploying OSTree with checksum 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f
Deploying done.
Copy files not under OSTree control from original deployment.
Packing rootfs...
Packing rootfs done.
Updating TorizonCore image in place.

=>> Build command successfully executed!

 $ torizoncore-builder images unpack output_directory/
Storage not empty. Delete current image before continuing? [y/N] y
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f from local repository...
957 metadata, 9228 content objects imported; 579.3 MB content written
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f
  TorizonCore Version: 6.2.0+build.2-tcbuilder.20230616081638

 $ torizoncore-builder deploy --remote-password 1 --remote-host verdin-imx8mm-06827711 --reboot
Pulling OSTree with ref base (checksum 49555272dd3a213e1283aaecbd6da1046fe299814d4ffcf90cb639276939b33f) from local archive repository...
Starting http server to serve OSTree.
OSTree server listening on "localhost:35401".
Starting OSTree pull on the device...
Deploying new OSTree on the device...
Deploying successfully finished.
Device reboot initiated...

And here is the result:

It is working for me.

Is it possible that you are missing some steps?

Could you please try following what I did here?

Best regards,

1 Like

Hi @henrique.tx ,

It doesn’t make sense why it’s not working on my end!
I’m considering reflashing the System-on-Module (SoM) and starting from scratch. What would be the easiest test to perform?

If I disable the UART, would it be a good idea to check if the Device Tree is modifiable after deploying the image? I don’t want to test SPI or add overlays or other things.

What do you think about disabling UART 3 for example, and observing the outcome? Also, I am going to share all the details from the beginning :slight_smile:

Best regards,
Mehrdad

Dear @henrique.tx ,

I hope you are doing well.

I wanted to express my sincere gratitude for the meeting we had regarding my case. :+1:

Your support and assistance were invaluable in resolving the issues I was facing. I truly appreciate the time you dedicated to helping me.

I am pleased to inform you that, with your guidance, I have successfully added a second SPI, disabled the PWMs and QSPI, and modified the device tree accordingly. These changes have greatly improved the functionality of the board, and I am thrilled with the results :smiley:

However, I have encountered a new challenge. Upon enabling UART4, the board restarts by itself. I have tried reflashing it, but the issue persists. As this seems to be a separate problem, I will be opening a new ticket to address this specific issue.

Thank you again for your expertise and support. :bouquet:

Best regards,
Mehrdad

1 Like

Hi @Mehrdad !

Thanks a lot for the feedback :slight_smile:

It is always rewarding to be able to help.

Thanks a lot for your kind words towards our support :slight_smile:

Please create the related new thread so we can take a closer look and try to reproduce the issue.

Have a nice day!

1 Like