Login Register
Mcuboot for telink microcontroller (tlsr9518adk80d kit) in zephyr_SDK v3.3.99
Jul 05, 2023 21:27




Hello every body!

I m working on a project for a Telink microcontroller (exactly the tlsr9518adk80d kit).

I am using zephyr_SDK v3.3.99 and everything is ok and all functions are working very well.

Now I want to make my code to be started by the bootloader.


- I built the Mcuboot for tlsr9518adk80d, and flashed it to address 0x0 in flash.

- I added (CONFIG_BOOTLOADER_MCUBOOT=y) in prj.conf of my project, build the project, signed the .bin file, and flashed it into slot 0 on the flash.

Bootloader starts normally and can see the image, confirm it s validity, and jump to the correct address on the flash. But.. the code does not start....

I repeated the work for (Blinky project and hellow_world project) but got the same result.

All these codes work normally without bootloader but with bootloader nothing works.

Is the Telink microcontroller needs to add some configuration in prj.conf ??

Can you help me deal with this problem.

5 replies
Jinmiao.Yu Jul 06, 2023 11:21

Could you provide your Zephyr commit? I will try to reproduce this issue on my side.

Jinmiao.Yu Jul 06, 2023 14:04

Your address seems wrong, as the tlsr9518adk80d.dts file shows, the slot0 is 0x18000, not 0x10080.

On my side everything works fine, here's my steps(use hello_word as example):

1. build mcuboot

west build -b tlsr9518adk80d -d build_mcuboot bootloader/mcuboot/boot/zephyr

2. build hello_word sample

west build -b tlsr9518adk80d -s zephyr/samples/hello_world -d build-hello-signed -- \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"bootloader/mcuboot/root-rsa-2048.pem\"

3. sign the hello_word sample

west sign -t imgtool -p bootloader/mcuboot/scripts/ -d build-hello-signed -- --key bootloader/mcuboot/root-rsa-2048.pem

4. flash mcuboot to address 0x0, flash signed hello word sample(zephyr.signed.bin, not zephyr.bin) to address 0x18000, then it works.

Majd [Author] Jul 06, 2023 18:27

Thank you very much!
I will try your steps exactly. but now I have another problem (my tlsr9518adk80d does not work)

I noticed that, on my version of zephyr the slot-0 start from 0x10000, and the offset 0x80 is because I uses the sign key with pad-header 128 bytes. Signing the .bin code without adding the header will return me an error. 

west sign -d build_hellow_world -t imgtool -- --pad --version 1.1.2 --pad-header --header-size 128 --key root-rsa-2048.pem

Now i am sure that the problem in the version of zephyr_SDK. Could you tell me please which version of zephyr you are using?

Jinmiao.Yu Jul 07, 2023 15:11

I‘m using the Zephyr from telink-semi repo, here is the specific Zephyr commit id: 873afebff10dc02ec881e2432a885e54c9f67b10

Here's the link:

Majd [Author] Jul 26, 2023 15:50

Thank you very much.
Yes, the problem was resolved by replacing the Zephyr.