2024-05-08 03:57 PM - edited 2024-05-08 04:10 PM
everything is working, downloads and runs, I am still not sure it the external QSPI works.
I can write and read from QSPI, checked but I am not sure if it works as external flash to load the code and run from it.
I chose to put main.c in external flash (is this the way you do ?)
but the bar in Keil only and always shows that it is loading to internal flash
2024-05-08 04:29 PM - edited 2024-05-08 05:34 PM
How much code is actually in main.c vs all the C and HAL library code?
To know where it's running, you could make a small routine in startup.s, that loads R0 with the LR, and returns.That way it will tell you where you're calling the function from.
CalledWhence PROC
EXPORT CalledWhence
MOV R0, LR
BX R0
ENDP
2024-05-08 04:56 PM
the main.c is less than 10K compared to the whole thing over 1M
the board is running I cannot confirm if from internal flash or external, I might still be missing something
2024-05-08 05:13 PM - edited 2024-05-08 05:23 PM
probably not once I made the file over 2MB
I get
Error: L6406E: No space in execution regions with .ANY selector matching ltdc.o(.constdata).
still, I am missing something
I get this warning
warning: L6314W: No section matches pattern Data.o(RO).
maybe here is the problem
2024-05-08 05:42 PM
So no RO data in data.c
Too much data in ltdc.c, would suggest putting *(.constdata) into the ER_ROM1 section
2024-05-08 05:59 PM
I did manage somehow to write to external qspi
but it always fails on verify, when I disable verify, it just sits there frozen does not run
maybe something wrong with the clocks when the external loader runs
I tried to check
https://developer.arm.com/documentation/kan333/1-0/?lang=en
there are two projects with some useful codes but none of them will compile, like 100 errors
I would not mind to buy those discovery boards used in those project but I doubt to get it working.
There is nothing else around working you could just load to the discovery board and see how it works
2024-05-08 06:12 PM
You've created this hybrid app that exists in the internal flash, and external flash.
When it first starts, the code in the internal flash will be executing, and the external will not be viable until its pins and peripheral are brought up. Any code for that to happen needs to be in internal flash.
The usual method here is to have a small boot loader (say 16 to 64KB) whose job is to bring up the clocks,the pins, and external memory peripheral. Once that is done you can pass control to an app that doesn't do that again, but can exist in internal/external memory out of the gate.
2024-05-08 06:37 PM
each CPU, MCU when boots up starts reading instructions from specific address in case of ARM it is from 0x8000000
you put whatever you want there to jump to 0x90000000
I see now my project the progress bar shows working from 0x8000000 for a short moment then goes to 0x90000000
it is easy to say but writing the code might take forever. it is easier to find something working and copy.
I might look at some of those STM32MP they do not come with internal flash only work with external
so it might be easy to look at some of the discovery boards to make your own.
2024-05-08 07:21 PM
2024-05-09 10:35 AM
this is for moving code from internal flash to external flash once it it up and running, I have no problem with this.
it does not help me to load more graphics
it might be the clock, delay, maybe needs some tuneup.
I have see contradicting suggestions
0x00001000, // Programming Page Size
and
0x00000100, // Programming Page Size
page is always 256 bytes