 Hello and welcome to this presentation. My name is Badr Dean and in this video we will learn how to set up a different OctoSpy flash memory in a TouchGFX template. In the two first parts we learned how to set up the OctoSpy peripheral in SDM32 Cubamax and then how to initialize the OctoSpy flash memory and set up the OctoSpy peripheral in memory mapped mode and this third part we'll see how to build the external flash loader for the IS-25LX-256 OctoSpy flash memory. I will first start by downloading the external flash loader for the SDM32-H7B discovery board and provided by SD. I will search for STM32 external flash loader in GitHub. In this GitHub we have all the external flash loaders for all the STM32 discovery kits and evaluation boards. These external flash loader are organized into STM32 families, STM32F4, STM32F7, G4 and so on so forth. In our case we are using STM32-H7 discovery kit so I'll click on STM32-H7X underscore boards and here we have all the external flash loaders for STM32-H7 family including the external flash loader for the STM32-H7B discovery board. I go back to the external flash loader and then from here I will download the zip. Starting from the external flash loader for the MX-25 memory and STM32-H7B discovery board I created a new project for the IS-25LX-256 OctoSpy memory. Now if I look at the STM32Q programmer user manual UM2237 and then at section 2.3.3 developing customized loaders for external memory. I see here we have three main steps. The first step is to update the device information in storage info structure and the device underscore and dot c file. I will open the IR project and application user core and then dev underscore and dot c. Here I changed the name to reflect the action name of the memory to IS-25LX-256 and then I changed the flash size. The IS-25LX-256 is 256 megabit flash memory which is 32 megabytes and then this is 2000000 and hexadecimal. Last if you look at the OctoSpy datasheet we see it's organized in 1024 subsectors of 32 kilobytes each. Go back to IR project and here in the sector number or pages number of pages is 1024 or 400 and hexadecimal and the size of each is 32 kilobytes or 8000 in hexadecimal value. Then the second step if I go back to STM32Q programmer user manual I see the second step is to change the corresponding functions code in the loader underscore source dot c file. I give back to IR project double click on loader underscore source dot c and here I have the functions to reset the OctoSpy memory set up the octal mode set up the dummy cycles and so on so forth. Here it's important to point out that interrupts are not important and actually there is no victor table we see there is no startup file in the project here and the default implementation of hall tick functions are like on sys tick however during the flash programming we want to ensure that no interrupts occur and avoid unnecessary initialization of additional peripherals thus new implementations of the hall tick functions is used so here the hall get tick hall delay and hall and tick then it's important as well to mention that the external loader project does not support the initialization of global variables for example the octa spy handler won't be zero initialized here because there is no startup code and for that reason I used memset here to zero initialize the octa spy handler now I go back to STM32Q programmer user manual and see the third step is to change the output fine name and go back to IAR build the project and here I have to change the output fine name from dot out to st ldr st loader I go to flash loader folder exe folder and here I have my output file dot out I change it to st ldr and now I'll copy the file to the stm32 cube by d external flash loader directory I go to c drive st stm32 cube by de then plugins and then stm32 cube by de external tools cube programmer then tools and bin folder and here we have the external flash loader directory here we see all the external flash loaders supported by stm32 cube by de I'll paste the file here this makes the external flash loader algorithm available in any stm32 cube by de project thank you for joining me in this video and we hope that you enjoyed learning how to set up a different octa spy flash memory in the third gfx template