When creating a simple L562 uVision app, uVision produces an error message about not being able to copy system_stm32l5xx_ns.c file to the app.
The ST HAL library V1.4.0 includes Template files system_stm32l5xx.c, system_stm32l5xx_ns.c and system_stm32l5xx_s.c, I believe the _ns.c and _s.c versions are for a Trust Zone application and not needed for a non-trust application. DFP 1.4.0 contains only a system_stm32l5xx.c file.
Defaulting to copying system_stm32l5xx.c should be the first fix. Determining if the app is a Trust Zone application probably requires a Managing Run Time Environment change.
Of course, if I got something wrong, please politely explain the error of my ways.
Edit: Copying a system_stm32l5xx_ns.c file from ST's HAL L5 library to the app is not a good workaround. This will cause the startup to hang before reaching main. A workaround that seems to work is to delete the system_stm32l5xx_ns.c file from the app, replace it with a system_stm32l5xx.c file and rename it to system_stm32l5xx_ns.c. But, of course, that is a hell of a way to run a railroad.
2nd Edit:
The hangup occurs when adding a PUTCHAR_PROTOTYPE <stdio> printf functionality, The .ns.c flash does not start the load at the beginning of flash, which causes the startup to run to stdio code that hits a breakpoint,
ST MX has a solution that works - an option to set up a non-TrustZone application for stm32L562 that works for a printf application.
Hello Popop!
I installed the STM32L5xx_DFP 1.4.0 and there is a system_stm32l5xx_ns.c:
Directory of C:\Keil\ARM\PACK\Keil\STM32L5xx_DFP\1.4.0\Drivers\CMSIS\Device\ST\STM32L5xx\Source\Templates
07.08.2023 17:02 <DIR> .07.08.2023 17:02 <DIR> ..07.08.2023 17:02 <DIR> arm07.08.2023 17:02 <DIR> gcc07.08.2023 17:02 <DIR> iar07.08.2023 17:02 13.912 system_stm32l5xx.c07.08.2023 17:02 9.179 system_stm32l5xx_ns.c07.08.2023 17:02 15.784 system_stm32l5xx_s.c
I also created a test project for the "STM32L562ZETxQ" and by default it gets the system_stm32l5xx_ns.c added to the project. So not sure what happen in your case. Can you try reinstalling the pack to see if this file is there then?