New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F7: Enabled cache #3422
STM32F7: Enabled cache #3422
Conversation
@blckmn , you seem to be enabling the I-Cache but not the D-Cache. Is that correct, and, if so, why? |
D cache needs serious consideration about cache write backs etc. Need to define regions it is not enabled on or has write through, due to dma. I cache is just instructions. |
@blckmn shouldn't the |
when the f722 linker script is updated to use the *_f7_split.ld, which is the only code I've seen that references the ITCMFL / ITCMFL1 regions the system fails to initialise. |
I did a bit of testing since the ICache seems to be unrelated to the other changes in this PR and have some findings for you: with ICache enabled
with ICache disabled
|
|
@hydra I know :) it's there for testing. In the existing F722 script you can replace the standard split with the F7 split. I'm still reading up on the MCU and seeing what gives the best performance |
Still playing with this, and unsure if I have this right yet. To enable you need to build with EXTRA_FLAGS=-DUSE_ITCM_RAM added to command line. e.g. |
src/main/fc/fc_init.c
Outdated
@@ -240,6 +240,12 @@ void spiPreInit(void) | |||
|
|||
void init(void) | |||
{ | |||
/* Load functions into ITCM RAM */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this code CPU specific?
src/main/target/common_fc_pre.h
Outdated
@@ -76,6 +76,12 @@ | |||
#define DEFAULT_AUX_CHANNEL_COUNT 6 | |||
#endif | |||
|
|||
#ifdef USE_ITCM_RAM | |||
#define CRITICAL_SECTION __attribute__((section(".critical_code"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRITICAL_SECTION
is very confusing name (https://en.wikipedia.org/wiki/Critical_section)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. My first thought when hearing the term Critical Section is the definition @ledvinap points to.
While I generally have a preference for logical names rather than physical names, I can't think of a good logical name. So I suggest we use the name ITCM_SECTION
- at least that has the benefit that it is clear to a reader what is going on.
i'll give the updated code a try soon. |
… targets with USE_ITCM_RAM defined.
@blckmn , what's the status of this PR? |
No description provided.