Hello @Community member and welcome to the Community :) ,
You can find source code of external loader (.stldr) for STM32 devices in this ST GitHub.
This repository contains dedicated folder for external loaders. There are many projects for ST evaluation boards and memory sales types.
Additionally, you can visit ST education material - How to create an external QSPI loader MOOC.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.