Skip to main content
Visitor II
September 18, 2021
Question

Issue building image for Azure IOT on STM32MP157C-DK2

  • September 18, 2021
  • 6 replies
  • 2748 views

I'm build an image for Azure IOT on STM32MP157C-DK2, following this tutorial: https://wiki.st.com/stm32mpu/wiki/How_to_integrate_Azure_IoT_Edge_on_OpenSTLinux

but I have follow error:

| error: attributes are not yet allowed on `if` expressions

|  --> /usr/src/debug/iotedge-daemon/1.1.6-r0/iotedge-1.1.6/vendor/sysinfo/src/utils.rs:27:5

|  |

| 27 |   #[allow(clippy::identity_conversion)]

|  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| error: aborting due to previous error

| error: could not compile `sysinfo`.

There is a possible solution?

Looking a similar issues, it seem a problem of version of Rust: https://github.com/Frederick888/git-credential-keepassxc/issues/12

There is a way to udate the Rust version used for build?

    This topic has been closed for replies.

    6 replies

    Graduate
    September 19, 2021

    Hello,

    have you installed all the dependencies needed for the Distribution package building?

    Br,

    EBelt.1Author
    Visitor II
    September 19, 2021

    Yes, I did. once I make follow command:

    DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh

    it asked me all dependencies. I installed them and after when I re launch the command, it say was all ok and I started the build.

    Can I ask witch versions of repository of those layers are tested in the tutorial?

    PC $>git clone -b dunfell https://github.com/Azure/meta-iotedge.git

    PC $>git clone git://github.com/meta-rust/meta-rust.git

    PC $>git clone -b dunfell git://git.yoctoproject.org/meta-virtualization

    I noticed that the are some update in repository meta-iotedge.git in date after the last update of article.

    ST Employee
    September 20, 2021

    Hello @EBelt.1​ 

    to build Rust packages, I am using this repository:

    https://github.com/rust-embedded/meta-rust-bin

    It may help you. This layer supports Rust 1.54 and it is easy to upgrade to 1.55 (use the script build-new-version.sh).

    Best regards,

    --JM

    EBelt.1Author
    Visitor II
    September 20, 2021

    Thank you for your support. Just to understand (I'm pretty new to this builds), you say to replace those steps:

    git clone git://github.com/meta-rust/meta-rust.git

    bitbake-layers add-layer [your STM32MP1 Distribution path]/meta-rust/

    with:

    git clone https://github.com/rust-embedded/meta-rust-bin

    bitbake-layers add-layer [your STM32MP1 Distribution path]/meta-rust-bin/

    About that, I looking that has a specific branch for dunfell, instead meta-rust-bin has only for dizzy and zeus. What branch should I use? The master branch?

    ST Employee
    September 20, 2021

    @EBelt.1 

    Yes, you can use the master branch. The compatibility layer as defined in conf/layer.conf includes dunfell.

    Best regards,

    --JM

    EBelt.1Author
    Visitor II
    September 20, 2021

    I tried to use meta-rust-bin, but the layer iot edge looks to depend on meta-rust:

    ERROR: Layer 'meta-iotedge' depends on layer 'rust-layer', but this layer is not enabled in your configuration

    ST Employee
    September 21, 2021

    Hello @EBelt.1​ 

    ok, I was not aware of this dependency. Too bad, the meta-rust-bin layer is quite quick ;)

    To come back to your initial question, you can update the Rust compiler version by setting the variable RUST_VERSION = "1.55.0" (or other values) in your local.conf file.

    About the versions used in the tutorial:

    meta-iotedge : branch dunfell : commit 6840cf2afb51b4f2c535a05d5635736652f664f7
    meta-virtualization : branch dunfell : commit 502b81ae3ae11bf4d889b7eff6239fb9e6c55994
    meta-rust : branch master : commit e4d25b98083bcecb94df6ee189a165d63ede7f3d

    The tutorial has been validated against the delivery ecosystem release v3.0.0 so be sure to used it.

    Best regards,

    --JM

    EBelt.1Author
    Visitor II
    September 22, 2021

    Thank you for the suggestion! I added RUST_VERSION = "1.55.0" to local.conf and aligned layers as suggested, but I had an error on building virtualitation (a repo was not found), but moving virtualitation to lastest everything work fine.

    So, my final set was:

    meta-iotedge : branch dunfell : commit 6840cf2afb51b4f2c535a05d5635736652f664f7

    meta-rust : branch master : commit e4d25b98083bcecb94df6ee189a165d63ede7f3d

    meta-virtualization : branch dunfell : latest commit

    RUST_VERSION = "1.55.0" in local.conf

    and I successfully build the image and connected to IOTedge.

    I noticed that the version of Iotedge is 1.1, that has know issues. Is it possible to update to version 1.2 of iotedge?

    ST Employee
    September 23, 2021

    Hello @EBelt.1​ 

    I am happy you successfully built your image! That's a good point!

    About your last question to migrate from 1.1 to 1.2 for the layer iotedge, I don't know. I think you should make an attempt on your side and select this version in your cloned repository and re-do the build.

    Best regards,

    --JM

    EBelt.1Author
    Visitor II
    September 23, 2021

    Thank you.

    I successfully build with latest version of iotedge with follow commits:

    meta-virtualization = dunfell 9e9868ef3d6e5da7f0ecd0680fcd69324593842 (latest)

    meta-iotedge   = 6840cf2afb51b4f2c535a05d5635736652f664f7 (latest)

    meta-rust      = 4b151fa804b1e78af445037e4136c133ada40a0 (rust == 1.47)

    Just a one more question:

    I changed ROOTFS_PARTITION_SIZE in /layers/meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc in order to increase the size of system partition (i.e. 8 gb), but once created the flash that change has not effect (the root partition is always 1.9 gb):

    Filesystem   Size Used Avail Use% Mounted on

    devtmpfs    147M   0 147M  0% /dev

    /dev/mmcblk0p6 1.9G 1.6G 222M 88% /

    tmpfs      214M  64K 214M  1% /dev/shm

    tmpfs      214M 8.8M 205M  5% /run

    tmpfs      214M   0 214M  0% /sys/fs/cgroup

    tmpfs      214M  52K 214M  1% /tmp

    /dev/mmcblk0p4  58M  14M  40M 27% /boot

    tmpfs      214M 192K 214M  1% /var/volatile

    /dev/mmcblk0p5  15M 6.8M 6.7M 51% /vendor

    /dev/mmcblk0p7  13G 1.6G  11G 14% /usr/local

    tmpfs      43M   0  43M  0% /run/user/0

    how can I change the size of root partition?

    ST Employee
    September 24, 2021

    Hello @EBelt.1​ 

    Once again a good piece of news!

    About your questions related to the increase of the ROOTFS_PARTITION_SIZE, do you also update IMAGE_ROOTFS_MAXSIZE in the same file so its value is bigger or equal to ROOTFS_PARTITION_SIZE?

    Hope it helps.

    Best regards,

    --JM