Seeking a new MACHINE_OR_TARGET for our hardware


(1) In our product, we have mounted a “ReSpeaker 2-Mic HAT board” on “Jetson-Xavier-Nx-Devkit”.

(2) We have intially tested the HAT board with Nx-Devkit running Jetpack. For HAT board to work, we need to make certain changes to the device tree, which we did by loading a DTBO file under Jetpack.

(3) However, now we are moving towards balena. Since balena does not support loading the DTBO files on xavier, as discussed here the alternative for us would be to create a new MACHINE_OR_TARGET .

(4) For local testing, we added a new MACHINE_OR_TARGET called jetson-xavier-seeed-hat on our fork. However, while trying to create the balena os image, build fails with following error:
Device type could not be found in the API, exiting

(5) I guess, to resolve the error described under step-(4), we need to request a new device id for our hardware. Is this correct? What will be the procedure for this? Can we just submit a pull-request and balena team will consider this? Or is there any other procedure?

Can some one from balena team let me know how to move forward on this issue.

Best Regards,

Hello there, if this is something that can be solved via PR then yes, most definitely that’s the correct approach. However, I’ll forward this to the OS team to see if they want to comment or maybe suggest something else.

Hi, when you say that the build fails while trying to create the balena os image, could you please details the steps you are following to build the image?


(1) I created a new machine type “jetson-xavier-seeed-hat” by
(a) adding a “jetson-xavier-seeed-hat.coffe” file
(b) adding “layers/meta-balena-jetson/conf/machine/jetson-xavier-seeed-hat.conf”
(c) Adding a custom dtb and accompanying changes for using the custom dtb

(2) For building balena os image, I used following commands
(a) export BALENA_PERSISTENCE= “path-to-the-persistent-folder”
(b) export MACHINE_OR_TARGET=jetson-xavier-seeed-hat
(c) export BUILD_TYPE=dev
(d) ./balena-yocto-scripts/automation/ -m ${MACHINE_OR_TARGET} --shared-dir ${BALENA_PERSISTENCE} --build-flavor ${BUILD_TYPE}

As such the build seem to progress well and all modules can be built without error. But, post that there is no “deploy-jenkins/image/”
as we encounter following error

[000009442][LOG]Build for jetson-xavier-seeed-hat suceeded.
[000009443][LOG]If build for jetson-xavier-seeed-hat succeeded, final image should have been generated here:
[000009443][LOG]   build/tmp/deploy/images/jetson-xavier-seeed-hat/balena-image-jetson-xavier-seeed-hat.balenaos-img
[INFO] Running cleanup...
[INFO] Stopping in container docker...
+ '[' false = true ']'
+ YOCTO_BUILD_DEPLOY=/home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//build/tmp/deploy/images/jetson-xavier-seeed-hat
+ DEVICE_TYPE_JSON=/home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//jetson-xavier-seeed-hat.json
++ jq --raw-output .slug /home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//jetson-xavier-seeed-hat.json
+ SLUG=jetson-xavier-seeed-hat
++ jq --raw-output .yocto.deployArtifact /home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//jetson-xavier-seeed-hat.json
+ DEPLOY_ARTIFACT=balena-image-jetson-xavier-seeed-hat.balenaos-img
++ jq --raw-output .state /home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//jetson-xavier-seeed-hat.json
++ cat layers/meta-balena/meta-balena-common/conf/distro/include/
++ grep -m 1 DISTRO_VERSION
++ cut -d ' ' -f3
+ '[' NEW '!=' DISCONTINUED ']'
++ cat /home/kunal/xyz/BuildBalena/balena-jetson/balena-yocto-scripts/automation/../..//build/tmp/deploy/images/jetson-xavier-seeed-hat/VERSION_HOSTOS
+ VERSION_HOSTOS=2.73.15+rev1
+ '[' '' = production ']'
++ curl -H 'Authorization: Bearer ' --silent --retry 5 '$filter=slug%20eq%20%27jetson-xavier-seeed-hat%27&$select=slug,is_private'
++ jq -r '.d[0]'
+ '[' null = null ']'
+ echo 'Device type could not be found in the API, exiting'
Device type could not be found in the API, exiting
+ exit 1

My assumption is that it is related to our MACHINE_OR_TARGET not being valid on the balena infrastructure. But I am not too sure. Can you please guide w.r.t. above error.

@tmigone and @alexgg
I have created a new pull request for this issue. Can you request someone from your team to have a look at it

Hi Kunal,

Thanks for the PR, I’ll pass that information to our OS team so they can take a look.

Looking at the commands you shared, it looks like you are trying to build using the from the automation repo. That script is meant to be run in the context of our CI so is unlikely you’ll get it to work even if the correct device type existed on the API.

You can find the correct instructions for building your custom image here balenaOS - Docs

Please let us know if you run into problems following that procedure.

Thanks @pipex

I tried building with BARYS tool today. I used following command

./balena-yocto-scripts/build/barys -m jetson-xavier-nx-devkit-seeed-hat

Build goes well, and I get this message towards end

[000006660][LOG]Build for jetson-xavier-nx-devkit-seeed-hat suceeded.
[000006660][LOG]If build for jetson-xavier-nx-devkit-seeed-hat succeeded, final image should have been generated here:
[000006660][LOG]   build/tmp/deploy/images/jetson-xavier-nx-devkit-seeed-hat/balena-image-jetson-xavier-nx-devkit-seeed-hat.balenaos-img

Now, in order to use the image, I need to inject the config file in to it. But, this step fails

->sudo ~/tools-balena/balena-cli/balena config inject ~/balena_workspace/BuildBalena/xavier_nx_config_files/staging-aivero-do-linux-armv8-l4t-t186.config.json --drive ./build/tmp/deploy/images/jetson-xavier-nx-devkit-seeed-hat/balena-image-jetson-xavier-nx-devkit-seeed-hat.balenaos-img  --type jetson-xavier-nx-devkit-seeed-hat
[sudo] password for xyz: 
BalenaInvalidDeviceType: Invalid device type: jetson-xavier-nx-devkit-seeed-hat

Any idea how I could inject config in the image file?

PS: I have built and tested the jetson-xavier-nx-devkit build with BARYS and it works ok. The problem I am running in to is related only to our custom board

@acostach Can you please suggest if it is possible to build images for a new board type, without having the device id.