# Mender - Tinkerboard - Python.h

**URL:** https://hub.mender.io/t/mender-tinkerboard-python-h/4227
**Category:** Other
**Tags:** tinkerboard, rockchip, u-boot, dunfell
**Created:** [October 25, 2021, 9:02am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227 "2021-10-25T09:02:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [October 25, 2021, 9:02am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/1 "2021-10-25T09:02:09Z")

</div>

# Device description

_[Tinker-Board-S](https://www.asus.com/de/Networking-IoT-Servers/AIoT-Industrial-Solutions/All-series/Tinker-Board-S/)_

Hello all,  
I am currently working on implementing a Mender Integeration on a Tinker-Board-S.  
As soon as I use the mender-uboot feature I unfortunately run into the following error!

# Setup

Using this layers: !(I use [Dunfell](https://wiki.yoctoproject.org/wiki/Releases))!

```auto
BBLAYERS ?= " \
  ${TOPDIR}/../layers/poky/meta \
  ${TOPDIR}/../layers/poky/meta-poky \
  ${TOPDIR}/../layers/poky/meta-yocto-bsp \
  ${TOPDIR}/../layers/meta-openembedded/meta-oe \
  ${TOPDIR}/../layers/meta-openembedded/meta-python \
  ${TOPDIR}/../layers/meta-openembedded/meta-networking \
  ${TOPDIR}/../layers/meta-mender/meta-mender-core \
  ${TOPDIR}/../meta-rockchip \
  ${TOPDIR}/../meta-player \
  "

```

And im using this local.conf

```auto
#
# MENDER CONFIGS
#
MENDER_ARTIFACT_NAME = "TinkerBoardTest"

# controls Mender features ...
MENDER_FEATURES_ENABLE_append = " \
    mender-image \
    mender-image-bios \
    mender-uboot \
    mender-systemd \
    mender-client-install \
    mender-growfs-data \
    "

MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
MENDER_STORAGE_TOTAL_SIZE_MB = "2048"
MENDER_DATA_PART_SIZE_MB = "128"

IMAGE_INSTALL_append = " mender-connect"

```

There is a change in the u-boot script on meta-rockchip (dunfell)

Link to change : [git.yoctoproject.org](https://git.yoctoproject.org/cgit/cgit.cgi/meta-rockchip/tree/recipes-bsp/u-boot?h=dunfell)

# Problem / Error

I have shortened the entire log a bit and collected only the most important messages. (If it is needed I can also provide the entire log)

```auto
| scripts/dtc/pylibfdt/libfdt_wrap.c:149:11: fatal error: Python.h: No such file or directory

[4140]| # include <Python.h>

[4141]| ^ ~~~~~~~~~

[4142]| compilation terminated.

[4143]| error: command 'gcc' failed with exit status 1

[4144]| scripts/dtc/pylibfdt/Makefile:27: recipe for target 'scripts/dtc/pylibfdt/_libfdt.so' failed

[4145]| make[3]: *** [scripts/dtc/pylibfdt/_libfdt.so] Error 1

[4146]| scripts/Makefile.build:432: recipe for target 'scripts/dtc/pylibfdt' failed

[4147]| make[2]: *** [scripts/dtc/pylibfdt] Error 2

[4148]| scripts/Makefile.build:432: recipe for target 'scripts/dtc' failed

[4149]| make[1]: *** [scripts/dtc] Error 2

[4150]| Makefile:551: recipe for target 'scripts' failed

[4151]| make: *** [scripts] Error 2

[4152]| WARNING: exit code 2 from a shell command.

[4153]| ERROR: Execution of '/opt/tinkerboard-runner/XEzD-GrN/0/scs/tinker-board-yocto/build/tmp/work/tinker_board_s-poky-linux-gnueabi/u-boot/1_2020.01-r0/temp/run.do_mender_uboot_auto_configure.17462' failed with exit code 2

[4154]NOTE: recipe u-boot-1_2020.01-r0: task do_mender_uboot_auto_configure: Failed

[4155]ERROR: Task (/opt/tinkerboard-runner/XEzD-GrN/0/scs/tinker-board-yocto/build/../layers/poky/meta/recipes-bsp/u-boot/u-boot_2020.01.bb:do_mender_uboot_auto_configure) failed with exit code '1'

```

# Allready tested !

> [@Pine A64-LTS](https://hub.mender.io/t/pine-a64-lts/3605/3):
>
> @ppeters how about to add u-boot\_%.bbappend following: ```DEPENDS\_append = " python3-native" and see if it helps. Thanks.

> **[\[OE-core\] \[PATCH\] u-boot: Fix missing Python.h build failure](https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg122172.html)**

```auto
Install python-dev on build machine
sudo apt-get install python-dev (tried python2-dev and python3-dev)

```

_ **I would be very pleased with any suggestion** _  
_ **Thanks Sebastian** _

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [October 26, 2021, 8:26pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/2 "2021-10-26T20:26:19Z")

</div>

@SebSauer Did you try to add this layer : [meta-mender-community/meta-mender-rockchip at dunfell · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/tree/dunfell/meta-mender-rockchip)

Isn’t it same board as you’re using? Please see: [Asus Tinker Board](https://hub.mender.io/t/asus-tinker-board/45)

Thanks.

---

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [October 27, 2021, 7:39am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/3 "2021-10-27T07:39:01Z")

</div>

@MarekBelisko Thanks for the response.  
Yes after some setbacks with my approach, I did everything exactly as described in the documentation.

Only one change I extended:

```auto
MENDER_FEATURES_ENABLE_append = " mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-image-uefi"

```

to :

```auto
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

```

This was followed by a huge wall of text (did not copy) into this error:  
_ **I actually didn’t expect grub-efi anymore.** _

```auto
| cc1: all warnings being treated as errors
| make[2]: *** [Makefile:6922: grub-core/fs/libgrubmods_a-cpio.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| In file included from ../grub-2.02/grub-core/fs/cpio_be.c:51:
| ../grub-2.02/grub-core/fs/cpio_common.c: In function 'grub_cpio_find_file':
| ../grub-2.02/grub-core/fs/cpio_common.c:58:31: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 58 | data->size = read_number (hd.filesize, ARRAY_SIZE (hd.filesize));
| | ~~^~~~~~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:60:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 60 | *mtime = read_number (hd.mtime, ARRAY_SIZE (hd.mtime));
| | ~~^~~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:61:28: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 61 | modeval = read_number (hd.mode, ARRAY_SIZE (hd.mode));
| | ~~^~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:62:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 62 | namesize = read_number (hd.namesize, ARRAY_SIZE (hd.namesize));
| | ~~^~~~~~~~~
| cc1: all warnings being treated as errors
| make[2]: *** [Makefile:6936: grub-core/fs/libgrubmods_a-cpio_be.o] Error 1
| make[2]: Leaving directory '/home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/build'
| make[1]: *** [Makefile:11247: all-recursive] Error 1
| make[1]: Leaving directory '/home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/build'
| make: *** [Makefile:3467: all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/temp/log.do_compile.773806)
ERROR: Task (virtual:native:/home/s/mender-rockchip/build/../sources/poky/meta/recipes-bsp/grub/grub-efi_2.02.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2417 tasks of which 0 didn't need to be rerun and 1 failed.

```

In my research, I found this:

> [@Orange-pi-zero](https://hub.mender.io/t/orange-pi-zero/1522):
>
> Hello to everyone. I’m trying to use meta-mender-core on the orange-pi-zero. [user@localhost build]$ bitbake-layers show-layers NOTE: Starting bitbake server... layer path priority ========================================================================== meta /yoctoproject/warriorVersion/poky/meta 5 meta-poky /yoctoproject/warriorVersion/poky/meta-poky 5 meta-yocto-bsp /yoctoproject/warriorVersion/poky/…

Therefore directly here my Distro\_Features:

```auto
bitbake -e | grep ^DISTRO_FEATURES
DISTRO_FEATURES="acl alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc libc-posix-wchar-io largefile opengl ptest multiarch wayland vulkan systemd pulseaudio bluez5 gobject-introspection-data ldconfig mender-uboot mender-image-sd mender-image mender-install mender-systemd"
DISTRO_FEATURES_BACKFILL="pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig mender-uboot mender-image-sd mender-grub mender-image mender-image-uefi mender-install mender-systemd systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED="sysvinit mender-grub mender-image-uefi sysvinit"
DISTRO_FEATURES_DEFAULT="acl alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
DISTRO_FEATURES_FILTER_NATIVE="api-documentation"
DISTRO_FEATURES_FILTER_NATIVESDK="api-documentation"
DISTRO_FEATURES_LIBC="ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc libc-posix-wchar-io"
DISTRO_FEATURES_LIBC_DEFAULT="ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc libc-posix-wchar-io"
DISTRO_FEATURES_LIBC_class-nativesdk="ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc libc-posix-wchar-io"
DISTRO_FEATURES_NATIVE="x11 ipv6 xattr"
DISTRO_FEATURES_NATIVESDK="x11 libc-charsets libc-locales libc-locale-code"

```

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [October 27, 2021, 7:43am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/4 "2021-10-27T07:43:21Z")

</div>

@SebSauer ok I’ll try to build locally and get back to you if I spot something. So you’re using dunfell now or other branch (as from board integration topic?). Thanks.

---

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [October 27, 2021, 7:49am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/5 "2021-10-27T07:49:07Z")

</div>

Thanks!  
After my failures I really went back and did it like in the tutorial so im on thud now!

```auto
/sources$ ls
meta-mender meta-mender-community meta-openembedded meta-rockchip poky

/sources/meta-mender$ git branch
* (HEAD detached at mender/thud)

/sources/meta-mender-community$ git branch
* (HEAD detached at mender/thud)

sources/meta-openembedded$ git branch
* (HEAD detached at oe/thud)

sources/meta-rockchip$ git branch
* (HEAD detached at yocto/thud)

/sources/poky$ git branch
* (HEAD detached at yocto/thud)

```

Should be all on “thud”

---

<div class="post-metadata">

### Author: ![dbasner](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dbasner/32/1373_2.png) [@dbasner](https://hub.mender.io/u/dbasner)
#### Post date: [October 28, 2021, 9:43am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/6 "2021-10-28T09:43:58Z")

</div>

I have the same issue as @SebSauer😕

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [October 28, 2021, 9:58am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/7 "2021-10-28T09:58:45Z")

</div>

@SebSauer so it works on thud and not on dunfell right?

---

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [October 28, 2021, 10:18am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/8 "2021-10-28T10:18:00Z")

</div>

So when I run it with the Dunfell Branches I run into the Python.h error (which is why I started the thread)

**ALL ON DUNFELL:**

```auto
BBLAYERS ?= " \
  /sources/poky/meta \
  /sources/poky/meta-poky \
  /sources/poky/meta-yocto-bsp \
  /sources/meta-mender/meta-mender-core \
  /sources/meta-openembedded/meta-oe \
  /sources/meta-rockchip \

```

I set it up again and only with local.conf changes: (only this!)  
and bbappend adapted

```auto
MACHINE = "tinker-board-s"
MENDER_ARTIFACT_NAME = "release-1"
INHERIT += "mender-full"
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

```

* * *

The second case, occurred only because I tried [Asus Tinker Board](https://hub.mender.io/t/asus-tinker-board/45)  
And the grub-errors appear there. Here also only the changes in local.conf as above.

Thanks!

---

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [November 8, 2021, 7:32am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/9 "2021-11-08T07:32:28Z")

</div>

_bump_  
Are there any updates ? @MarekBelisko

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 8, 2021, 7:48am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/10 "2021-11-08T07:48:40Z")

</div>

@SebSauer Sorry wasn’t working last week due family issues, I’ll start test build today 😉

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 8, 2021, 5:22pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/11 "2021-11-08T17:22:04Z")

</div>

@SebSauer made some progress but seems stock 2020.01 for this board cannot be compiled and it error with:  
`Error: SPL image is too large (size 0x11000 than 0x8000)` I’m checking what can be removed in order to fit SPL to this size ;). So if you can use thud release temporarily until this is resolved … 😉

---

<div class="post-metadata">

### Author: ![SebSauer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sebsauer/32/1486_2.png) [@SebSauer](https://hub.mender.io/u/SebSauer)
#### Post date: [November 9, 2021, 6:51am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/12 "2021-11-09T06:51:20Z")

</div>

for my understanding you tried a Dunfell build ? or did you run into this error with Thud ?  
Big thanks for helping

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 9, 2021, 7:10am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/13 "2021-11-09T07:10:45Z")

</div>

Yes dunfell, but I made some fixes to overcome issues you had (basically need to do board integration for dunfell branch)

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 11, 2021, 8:24am UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/14 "2021-11-11T08:24:11Z")

</div>

Asking for support here: [[meta-rockchip] dunfell: u-boot build issue when added patch to u-boot](https://lists.yoctoproject.org/g/yocto/message/55309) 😉

---

<div class="post-metadata">

### Author: ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)
#### Post date: [November 19, 2021, 12:32pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/15 "2021-11-19T12:32:18Z")

</div>

Hi @MarekBelisko,

@SebSauer and me are also facing this issue, do you have any update on this? Or any idea how to proceed?

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 19, 2021, 12:50pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/16 "2021-11-19T12:50:59Z")

</div>

Hmm no response from meta-rochchip guys. I’ll take a look again why mender code extend SPL and then it fails to compile.

---

<div class="post-metadata">

### Author: ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)
#### Post date: [November 19, 2021, 9:08pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/17 "2021-11-19T21:08:51Z")

</div>

To be honest, I don’t think it is mender related.

As far as I see the issue comes from here: [meta-mender-community/u-boot\_%.bbappend at dunfell · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/blob/dunfell/meta-mender-rockchip/recipes-bsp/u-boot/u-boot_%25.bbappend)

We copied this patch manually to our layer. When I remove this layer the build finishes. But the sdimg is wrong, doesn’t boot.

From my understanding of [Boot option - Rockchip open source Document](http://opensource.rock-chips.com/wiki_Boot_option) and [README.rockchip - doc/README.rockchip - U-boot source code (v2020.01) - Bootlin](https://elixir.bootlin.com/u-boot/v2020.01/source/doc/README.rockchip) (Chapter Booting from an SD card) I think we should do something like this in bbappend (NOT working! just an idea):

```auto
DEPENDS += "u-boot-mkimage-native "

UBOOT_ROCKCHIP_BINARY = "u-boot-rockchip.img"
UBOOT_IMAGE_ROCKCHIP ?= "u-boot-rockchip-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
UBOOT_SYMLINK_ROCKCHIP ?= "u-boot-rockchip-${MACHINE}.${UBOOT_SUFFIX}"

# "0x6000"
UBOOT_ROCKCHIP_BINARY_SIZE="24576"

do_compile_append_rk3288() {
    dd if=/dev/zero of=${UBOOT_ROCKCHIP_BINARY} bs=1M count=0 seek=${UBOOT_ROCKCHIP_BINARY_SIZE}
    dd if=${B}/${SPL_BINARY} of=${UBOOT_ROCKCHIP_BINARY} seek=64
    dd if=${B}/u-boot-dtb.img of=${UBOOT_ROCKCHIP_BINARY} seek=16384
}

do_deploy_append_rk3288() {
    install -m 644 ${B}/${UBOOT_ROCKCHIP_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE_ROCKCHIP}
    install -m 644 ${B}/u-boot-dtb.img ${DEPLOYDIR}/

    cd ${DEPLOYDIR}
    rm -f ${UBOOT_ROCKCHIP_BINARY} ${UBOOT_SYMLINK_ROCKCHIP}
    ln -sf ${UBOOT_IMAGE_ROCKCHIP} ${UBOOT_SYMLINK_ROCKCHIP}
    ln -sf ${UBOOT_IMAGE_ROCKCHIP} ${UBOOT_ROCKCHIP_BINARY}
}

```

What do you think @MarekBelisko

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 22, 2021, 4:03pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/18 "2021-11-22T16:03:05Z")

</div>

@ruben did you try to build image using only meta-rockchip on dunfell release? I tried and u-boot build fine. Issue only happens when meta-mender-community patches are added to u-boot then it overflow SPL size (didn’t find cause yet though). So to debug this issue I would try

- build image using meta-rockchip without mender and verify if it boots (I don’t have board so cannot try it 😉 )
- be aware that mender integration for rochchip on dunfell branch is obsolete and not up to date so I tried to update it with following patch:

```diff
index d6fe02c..0c52076 100644
--- a/meta-mender-rockchip/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-mender-rockchip/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1,4 +1,12 @@
-DEPENDS += "u-boot-mkimage-native"
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+DEPENDS += "u-boot-mkimage-native python3-native"
+
+MENDER_UBOOT_AUTO_CONFIGURE = "0"
+
+SRC_URI_remove = "file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"
+SRC_URI += "file://0001-Mender-offset-size-for-env.patch \
+ file://0002-More-mender-defines.patch"
 
 UBOOT_ROCKCHIP_BINARY = "u-boot-rockchip.img"
 UBOOT_IMAGE_ROCKCHIP ?= "u-boot-rockchip-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"

```

I’ve added patches here: [From d322a5393af423b6341724c1f7aea7cc99dfd0df Mon Sep 17 00:00:00 2001From: Ma - Pastebin.com](https://pastebin.com/b8BTy1SX)

With those changes there is overflow issue I wasn’t able to resolve it and also asked on meta-rockchip but no reply. So those are things I did so I think it can be good start 😉 for someone who have platform to try. Thanks.

---

<div class="post-metadata">

### Author: ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)
#### Post date: [November 22, 2021, 4:39pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/19 "2021-11-22T16:39:58Z")

</div>

Hi @MarekBelisko

thanks for your response. I already tried a build without mender integration. This build boots and works so far. But I tested not too much.

I am a little bit confused about partitioning. In Yocto build without mender the partitioning is based on wic-file in meta-rockchip layer:  
tinkerboard.wks

```auto
include rk3288-boot.wks

part / --align 131072 --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root

bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"

```

rk3288-boot.wks

```auto
# Disk layout
# Note that the reference documentation refers to 512 byte disk sectors, but
# wic uses 1KB blocks
#
# Partition Start Sector Number of Sectors
# loader1 64 8000
# reserved1 8064 128
# reserved2 8192 8192
# loader2 16384 8192
# atf 24576 8192
# boot 32768 229376
# root 262144 -
#

part loader1 --align 32 --size 4000K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=idbloader.img"
part reserved1 --align 4032 --size 64K --ondisk ${RK_BOOT_DEVICE}
part reserved2 --align 4096 --size 4096K --ondisk ${RK_BOOT_DEVICE}
part loader2 --align 8192 --size 4096K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=u-boot.bin"
part atf --align 12288 --size 4096K --ondisk ${RK_BOOT_DEVICE}
part /boot --align 16384 --size=114688K --active --ondisk ${RK_BOOT_DEVICE} --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"

```

This also matches with the documentation in rockchip wiki and u-boot sources from my last post.

When I do the mender integration I get only 4 partitions:

- bootloader
- a
- b
- data

What do you think belongs to which partition? My idea would be

- bootloader partition contains loader1 and loader2 (spl and u-boot)  
bootloader needs to be patched to load kernel from rootfs (not sure if possible or already done). And bootloader partition must be designed to have loader1 (spl) at sector 64 and u-boot at sector 16384.  
@mirzak Perhaps you can help here as you did the initial setup for the tinkerboard?

Thanks and best regards  
Ruben

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [November 22, 2021, 4:49pm UTC](https://hub.mender.io/t/mender-tinkerboard-python-h/4227/20 "2021-11-22T16:49:47Z")

</div>

Hi @ruben yes this could be definitely problem if image is not partitioned properly. I think mender wks is missing `rk3288-boot.wks` include IMO. But yes @mirzak probably knows more.

[Next page](https://hub.mender.io/t/mender-tinkerboard-python-h/4227.md?page=2)
