How do you open mcuboot from Nordic Connect SDK as separate project in CLion?

已回答

I need to change signing method to be N of M Ed25519 signatures in mcuboot fork from Nordic Connect SDK 2.9.0

The issue is that it's unclear or not possible to get the proper defines passed to CLion so that it parses mcuboot code correctly.

The important method to change is bootutil_img_validate in bootloader/mcuboot/boot/bootutil/src/image_validate.c

There are several obstacles in loading mcuboot as project, since it is normally defined as sysbuild module, so the zephyr plugin does actually work against you (and doesn't seem to be able to be switched to CMake).

On top of that, the “parent app” somehow generates and passes bunch of defines and whatnot when building via west (see below).

Taking a sample application, e.g. peripheral_bms, adding two files, you can create build with mcuboot as bootloader before the app, that also allows “serial recovery”, i.e. updating the app though bootloader (data passed via UART).

The sysbuild.conf contains just these two lines:

SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_MCUBOOT_MODE_SINGLE_APP=y

(it's using mcuboot and it's using it in single-slot-app mode as opposed to two slots).

In sysbuild/mcuboot.conf:

#CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
CONFIG_UART_NRFX=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# MCUBoot serial
CONFIG_GPIO=y
CONFIG_GPIO_NRFX_INTERRUPT=n
CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_CDC_ACM=n
CONFIG_BOOT_SERIAL_UART=y
# console must be disabled to have UART available for update/mcumgr.
CONFIG_UART_CONSOLE=n
# For baudrate 921600, disable this logging
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y

Build is done for nRF52840 example board like this - sysbuilds says to use the mcuboot from sysbuild, pristine is to keep it clean rebuild every time

west build -b nrf52840dk/nrf52840 --sysbuild --pristine=always .

However after many weeks I was not unable in any way to open the mcuboot part separately to have symbols parsed correctly, which is caused due to the defines missing (no idea where west chugs them in the cmake/kconfig/cmake lasagna layers, verbose print does not help either).

 

Any idea how to do this?

0

Hi Ondrej!

Sorry for the silence on our part. 

There are several obstacles in loading mcuboot as project, since it is normally defined as sysbuild module

Please take a look at the pinned comment in CPP-43380. I hope it helps.

and doesn't seem to be able to be switched to CMake

As I've mentioned in your other post, here is an action to convert a West project back to CMake - https://www.jetbrains.com/help/clion/zephyr.html#convert-cmake-to-west.

0

请先登录再写评论。