2020-06-02 04:22 AM
Hi,
I have a question with linker descriptions. I am using the sbsfu example projects of STM32L432KCUx with my user application which runs on STM32L452CEUX. This user application had the attached different linker description.
I modified the linker descriptions for SECorebin and SBSFU projects.
Could anyone let me know if the modifications are correct and inline with the linker description of user application.
2020-06-16 07:59 AM
Hello,
I could see no change on SBSFU and SECoreBin files except alignment to 4 instead of 8. Not sure to catch the reason for that.
Regarding your application's linker file, please use the same base address as in the original example.
Here your application is linked at the beginning of the flash which will not work for sure.
The application is launched by the SBSFU, SBSFU occupies the beginning of the flash.
Application is located in SLOT 0.
In orginal linker file you can see:
__ICFEDIT_intvec_start__ = __ICFEDIT_region_SLOT_0_start__ + 0x200;
APPLI_region_ROM_start = __ICFEDIT_region_SLOT_0_start__ + VECTOR_SIZE + 0x200;
It is not mandatory to reuse the same definitions, but at least use the same addresses.
Best regards
Jocelyn
2020-06-17 02:10 AM
Hi Jocelyn,
Thanks for your support. Yes I have modified the files accordingly and could compile my application which is integrated to SBSFU and SECoreBin projects.
I am facing new problem now !!. When I try to debug the SBSFU project on my controller (STM32L452CEUX). After the execution of function SFU_BOOT_ForceReboot();, I keep getting the below errors. Could you please let me know what could be the problem. Is it because of the memory mapping changes I made? I am really not sure.
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Erasing memory corresponding to segment 1:
Erasing internal memory sectors [0 10]
Erasing memory corresponding to segment 2:
Erasing internal memory sector 11
Erasing memory corresponding to segment 3:
Erasing internal memory sectors [12 28]
File segment @0x08000204 is not 8-bytes aligned. It will be aligned to @0x08000200
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:04.376
Verifying ...
Download verified successfully
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Error! Failed to read target status
Debugger connection lost.
Shutting down...
Thanks,
Ankush
2020-06-17 02:39 AM
Hello Ankush,
did you deactivate the protections in app_sfu.h ?
Also, what is your environment ? Is it CubeIDE?
Best regards
Jocelyn
2020-06-17 03:38 AM
Hallo Jocelyn,
Yes. I disabled RDP and WRP protections in the app_sfu.h and I am using CubeIDE :)
Thanks,
Ankush
2020-06-17 04:07 AM
Hello Ankush,
please disable ALL protections when debugging.
For instance, watchdog, DAP will lead to problems.
Best regards
Jocelyn
2020-06-17 04:30 AM
Hello Jocelyn,
Thanks for the input. yes I disabled everything and I dont see the "Target is not responding, retrying..." error. But The SBSFU service not getting intialized. When I slowly debugged the code, I found where exactly it is giving the problem. It is from from the below code.
if (!(SFU_IMG_REGION_IS_MULTIPLE(SFU_IMG_SLOT_0_REGION_SIZE, SFU_IMG_SWAP_REGION_SIZE)))
{
TRACE("\r\n= [FWIMG] The image slot size (%d) must be a multiple of the swap region size (%d)\r\n",
SFU_IMG_SLOT_0_REGION_SIZE, SFU_IMG_SWAP_REGION_SIZE);
e_ret_status = SFU_IMG_INIT_SLOTS_SIZE_ERROR;
}
I guess the image slot size is not the multiple of the swap region.