External loader STM32L442 and S25FL127 Cypress
Hello all,
I have written a External Loader using nucleo-l476rg and S25FL127 16mb NOR flash using 64k sectors. I was using it with TouchGFX and it worked just fine.
I migrated to stm32l442. I have copied the code for the flash driver, changed the linker etc. as of this video https://www.youtube.com/watch?v=YFIvJVsvIsE
The loader for the 442 does not work. It does not read or write in CubeProgrammer. I could put the memory into memory mapped mode, read and write to it when using the 442 when I debug the test code provided in the example. So the code is still good.
My suspicions are that the 442 has only 64K of SRAM and this might be the problem. How can I fix this? Are there any other reasons for the loader not to work.
Some notes:
- I can provide the code for the flash if needed.
- Also I want to use the 64k sectors so that my memory sectors are uniform.
- I am adding the log from the CubeProgrammer if it is of help:
- I don't think the problem is HW. I am running it on low frequencies, I have added decupling capacitor and pull up resistor on CS as per instructions. Also it runs on the nucleo.
17:54:11:863 : UPLOADING ...
17:54:11:864 : Size : 1024 Bytes
17:54:11:864 : Address : 0x90000000
17:54:11:864 : Read progress:
17:54:11:864 : Reading data...
17:54:11:864 : halt ap 0
17:54:11:864 : w ap 0 reg 15 PC (0x20000000)
17:54:11:865 : w ap 0 reg 17 MSP (0x20000500)
17:54:11:865 : w ap 0 reg 16 xPSR (0x01000000)
17:54:11:865 : Init flashloader...
17:54:11:865 : halt ap 0
17:54:11:865 : w ap 0 reg 0 R0 0x00000000
17:54:11:865 : w ap 0 reg 1 R1 0x00000000
17:54:11:865 : w ap 0 reg 2 R2 0x00000000
17:54:11:865 : w ap 0 reg 3 R3 0x00000000
17:54:11:866 : w ap 0 reg 4 R4 0x00000000
17:54:11:866 : w ap 0 reg 5 R5 0x00000000
17:54:11:866 : w ap 0 reg 6 R6 0x00000000
17:54:11:866 : w ap 0 reg 7 R7 0x00000000
17:54:11:866 : w ap 0 reg 8 R8 0x00000000
17:54:11:866 : w ap 0 reg 9 R9 0x00000000
17:54:11:867 : w ap 0 reg 10 R10 0x00000000
17:54:11:867 : w ap 0 reg 11 R11 0x00000000
17:54:11:867 : w ap 0 reg 12 R12 0x00000000
17:54:11:867 : w ap 0 reg 13 SP 0x00000000
17:54:11:867 : w ap 0 reg 14 LR 0x00000000
17:54:11:868 : w ap 0 reg 15 PC 0x20000579
17:54:11:868 : w ap 0 reg 16 xPSR 0x01000000
17:54:11:869 : w ap 0 reg 17 MSP 0x00000000
17:54:11:869 : w ap 0 reg 18 PSP 0x00000000
17:54:11:869 : run ap 0
17:54:16:000 : halt ap 0
17:54:16:000 : Init function fail with timeout
17:54:16:002 : r ap 0 reg 16 xPSR 0x41000003
17:54:16:007 : halt ap 0
17:54:16:007 : w ap 0 reg 15 PC (0x20000000)
17:54:16:008 : w ap 0 reg 17 MSP (0x20000500)
17:54:16:008 : w ap 0 reg 16 xPSR (0x01000000)
17:54:16:008 : Error: Data read failed