Using lvgl with TF-M doesn't work: tfm_arch_set_secure_exception_priorities();

Hi,

I'm using an nRF5340DK and an Adafruit 2.8" TFT Touch Shield to implement a touch keyboard on the board. My project uses TF-M, so I'm trying to integrate lvgl into the tfm_secure_partition sdk sample, but it doesn't work.

I have added lvgl configuration, but I don't use any lvgl function. The program print any printk from main. Doing a debug, it stops at the following line of code.

This file is located in the following path: ...\Nordic\v2.2.0\modules\tee\tf-m\trusted-firmware-m\secure_fw\spm\cmsis_psa\main.c

I'm using an Adafruit 2.8" TFT Touch Shield, so I have added the following configuration to CMakeLists.txt:

set(SHIELD adafruit_2_8_tft_touch_v2)

prj.conf:

CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=8
CONFIG_MAIN_STACK_SIZE=17408

CONFIG_DISPLAY=y
CONFIG_DISPLAY_LOG_LEVEL_ERR=y

CONFIG_LOG=y

CONFIG_LVGL=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_USE_LOG=y
CONFIG_LV_USE_LABEL=y
CONFIG_LV_FONT_MONTSERRAT_14=y

CONFIG_PM_PARTITION_SIZE_TFM=0x60000

I attach the project, in case it is useful to reproduce the problem: 

tfm_secure_partition_lvgl.zip

Regards,
Pablo

Useful information about the project:

- Using nRF5340DK and an Adafruit 2.8" TFT Touch Shield
- Using nRF Connect SDK v2.2.0.
- The project is based on the example: TF-M Secure Partition Sample 

Parents
  • Hi,

    I tried to run your project on a 5340 DK, but I was not able to reproduce the same error. Instead, I got a busfault in the application when it tried to configure TWIM1 for the display's touch controller. This is because TWIM1 is shared with the UARTE1 peripheral (Peripherals with shared ID) and TF-M is already using it for logging with the current configuration.

    Please try to disable logging in TF-M and see if you still get the same crash. You can disable it by adding the following settings to your prj.conf:

    CONFIG_TFM_SECURE_UART1=n
    CONFIG_TFM_LOG_LEVEL_SILENCE=y
     

    Regards,

    Vidar

Reply
  • Hi,

    I tried to run your project on a 5340 DK, but I was not able to reproduce the same error. Instead, I got a busfault in the application when it tried to configure TWIM1 for the display's touch controller. This is because TWIM1 is shared with the UARTE1 peripheral (Peripherals with shared ID) and TF-M is already using it for logging with the current configuration.

    Please try to disable logging in TF-M and see if you still get the same crash. You can disable it by adding the following settings to your prj.conf:

    CONFIG_TFM_SECURE_UART1=n
    CONFIG_TFM_LOG_LEVEL_SILENCE=y
     

    Regards,

    Vidar

Children
Related