Hi All,
I encountered some issues while setting up a Trusted Firmware-M project using the EK-RA8M1 development board in the FSP 5.1.0 environment. The official resources only provide a sample project for FSP 2.0.3. Could you please let me know if there is a more recent sample available?
Here are some settings I made in the project:
Configuration for tfm_bootloader2
Main stack size (bytes): 0x1000Heap size (bytes): 0x1000Flash Layout | FLASH_OTP_NV_COUNTERS_AREA_OFFSET: BSP_FEATURE_FLASH_DATA_FLASH_STARTGeneral | Number of Images Per Application: 2 (TrustZone)General | Data Sharing: EnabledFlash Layout | TrustZone | Non-Secure Callable Region Size (Bytes): 0x800Flash Layout | TrustZone | Non-Secure Flash Area Size (Bytes) (TrustZone Non-Secure): 0x80000Flash Layout | TrustZone | Non-Secure Callable RAM Region Size (Bytes): 0x800Flash Layout | TrustZone | Non-Secure RAM Region Size (Bytes) (TrustZone Non-Secure): 0xA0000Flash Layout | TrustZone | Image 2 Header Size (Bytes): 0x400Flash Layout | Bootloader Flash Area Size (Bytes): 0x18000Flash Layout | Image 1 Header Size (Bytes): 0x400Flash Layout | Image 1 Flash Area Size (Bytes): 0x50000Flash Layout | Scratch Flash Area Size (Bytes): 0x0Data Sharing | Maximum Measured Boot Record Size (Bytes): 0x64Data Sharing | Shared Data Size (Bytes): 0x380Data Sharing | Shared Data Address: 0x22000000
Other configurations are omitted to avoid errors.
void hal_entry(void) { /* TODO: add your own code here */ bl2_main(); #if BSP_TZ_SECURE_BUILD /* Enter non-secure code */ R_BSP_NonSecureEnter(); #endif }
Configuration for tfm_s
Main stack size (bytes): 0x2000Heap size (bytes): 0x1000C Runtime Initialization: DisabledFlash Layout | FLASH_SECURE_RAM_SIZE: 0x3f800Flash Layout | FLASH_ITS_AREA_OFFSET: 0x08001000
void hal_entry(void) { /* TODO: add your own code here */ extern uint32_t __stack; extern uint64_t __STACK_SEAL; __set_CONTROL_SPSEL(1); __set_PSP(&__stack); __TZ_set_STACKSEAL_S(&__STACK_SEAL); tfm_main(); #if BSP_TZ_SECURE_BUILD /* Enter non-secure code */ R_BSP_NonSecureEnter(); #endif }
Configuration for tfm_ns
This is the blinky_thread_entry project.
void blinky_thread_entry(void *pvParameters) { FSP_PARAMETER_NOT_USED(pvParameters); tfm_ns_interface_init(); ... }
Secure/Non-Secure Boundaries
Set in e2studio: 734, 2, 6, 254, x
Issue Encountered
The code path in tfm_s:
tfm_main -> tfm_core_handler_mode() -> tfm_core_svc_handler() -> tfm_arch_free_msp_and_exc_ret(SPM_BOOT_STACK_BOTTOM, exc_return) -> common_sfn_thread() -> Default_Handler()
In common_sfn_thread(), the line meta = PART_METADATA(); runs, and the value of meta is 0x00.
Thanks.
Hello,
Thanks for reaching out Renesas Engineering Community.
I am sorry but the only available version of this app note we have is for RA6M4 and for FSP version 2.0.3.
And as far we know there aren't any plans to update this app note.
As you can see here in our official github page: https://github.com/renesas/ra-fsp-examples/tree/master/application_projects/r11an0493
For this app note the last commit was 3 years ago and the sample code available if for FSP 2.0.3.
Best Regards,
IK