Hi everyone,
I'm trying to access an STM32L552 peripheral in a RoT APP (tf-m isolation v1.4 Level 2), but I'm having trouble doing that.
I know that I have to request the peripheral in the YAML file of my partition's manifest, but that request didn't work for me. I filled the required campus and couldn't get access to the peripheral. I'm requesting the peripheral by putting this piece of code in my partition manifest YAML file. Am I missing something?
..... "mmio_regions" : [ { "name": "TFM_PERIPHERAL_TIMER0", "permission": "READ-WRITE" } ......
Another thing, I am only able to request the TIMER0 and UART peripherals? If I want to access other timers, e.g., TIMER 6 or TIMER 7, am I not allowed to do so?
Cheers, Cristiano
Hi Cristiano,
Peripheral are platform-specific sources. SPM binds the partition specific hardware by the HAL API tfm_hal_bind_boundaries() when the partition is getting loaded. Hence you need to make sure the platform binding is successful. The reference mechanism in the code base helps the binding by define available peripheral list in the platform, you can check these points:
1. Add mmio settings in the YAML file, which you have done correctly. 2. Define TFM_PERIPHERAL_TIMER0 macro with correct platform peripheral structure address, in platform/ext/target/stm/common/stm32l5xx/boards/tfm_peripherals_def.h. 3. Add the peripheral name to “partition_named_mmio_list[]” in the file platform/ext/target/stm/common/stm32l5xx/boards/mmio_defs.h. 4. Make sure the APP-RoT has correct permission to access the peripheral drivers.
You could refer from AN521 platform to see how these things are set. The above settings also apply to other peripherals, change the name and associate it to the correct peripheral.
Regards, Mingyang
From: TF-M tf-m-bounces@lists.trustedfirmware.org On Behalf Of Cristiano Rodrigues via TF-M Sent: Sunday, September 26, 2021 1:25 AM To: tf-m@lists.trustedfirmware.org Subject: [TF-M] Request Access To a Board Peripheral for a App RoT - Problem
Hi everyone,
I'm trying to access an STM32L552 peripheral in a RoT APP (tf-m isolation v1.4 Level 2), but I'm having trouble doing that.
I know that I have to request the peripheral in the YAML file of my partition's manifest, but that request didn't work for me. I filled the required campus and couldn't get access to the peripheral. I'm requesting the peripheral by putting this piece of code in my partition manifest YAML file. Am I missing something?
..... "mmio_regions" : [ { "name": "TFM_PERIPHERAL_TIMER0", "permission": "READ-WRITE" } ......
Another thing, I am only able to request the TIMER0 and UART peripherals? If I want to access other timers, e.g., TIMER 6 or TIMER 7, am I not allowed to do so?
Cheers, Cristiano
Hi Mingyang,
Thanks for the reply. It worked for me.
Best Regards, Cristiano
On Sun, Sep 26, 2021 at 4:14 AM Mingyang Sun Mingyang.Sun@arm.com wrote:
Hi Cristiano,
Peripheral are platform-specific sources. SPM binds the partition specific hardware by the HAL API tfm_hal_bind_boundaries() when the partition is getting loaded. Hence you need to make sure the platform binding is successful.
The reference mechanism in the code base helps the binding by define available peripheral list in the platform, you can check these points:
- Add mmio settings in the YAML file, which you have done correctly.
- Define TFM_PERIPHERAL_TIMER0 macro with correct platform peripheral
structure address, in *platform/ext/target/stm/common/stm32l5xx/boards/tfm_peripherals_def.h* . 3. Add the peripheral name to “partition_named_mmio_list[]” in the file *platform/ext/target/stm/common/stm32l5xx/boards/mmio_defs.h*. 4. Make sure the APP-RoT has correct permission to access the peripheral drivers.
You could refer from AN521 platform to see how these things are set.
The above settings also apply to other peripherals, change the name and associate it to the correct peripheral.
Regards,
Mingyang
*From:* TF-M tf-m-bounces@lists.trustedfirmware.org * On Behalf Of *Cristiano Rodrigues via TF-M *Sent:* Sunday, September 26, 2021 1:25 AM *To:* tf-m@lists.trustedfirmware.org *Subject:* [TF-M] Request Access To a Board Peripheral for a App RoT - Problem
Hi everyone,
I'm trying to access an STM32L552 peripheral in a RoT APP (tf-m isolation v1.4 Level 2), but I'm having trouble doing that.
I know that I have to request the peripheral in the YAML file of my partition's manifest, but that request didn't work for me. I filled the required campus and couldn't get access to the peripheral. I'm requesting the peripheral by putting this piece of code in my partition manifest YAML file. Am I missing something?
.....
"mmio_regions" : [ { "name": "TFM_PERIPHERAL_TIMER0", "permission": "READ-WRITE" }
......
Another thing, I am only able to request the TIMER0 and UART peripherals? If I want to access other timers, e.g., TIMER 6 or TIMER 7, am I not allowed to do so?
Cheers,
Cristiano
tf-m@lists.trustedfirmware.org