cancel
Showing results for 
Search instead for 
Did you mean: 

how to check if program is indeet loaded to exteral flash and runs from there?

MNapi
Senior III

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 ?)

1.png

4.png

 

2.png

 

but the bar in Keil only and always shows that it is loading to internal flash

3.png

11 REPLIES 11

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

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

 

5.png

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

So no RO data in data.c

Too much data in ltdc.c, would suggest putting *(.constdata) into the ER_ROM1 section

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I did manage somehow to write to external qspi

6.png

but it always fails on verify, when I disable verify, it just sits there frozen does not run

7.png

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

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.

 

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