diff options
author | Antonin ENFRUN <antonin.e@me.com> | 2016-09-08 00:02:17 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-09 14:48:15 +1000 |
commit | f3b19ef6347f41b073b27c7a83a12cfc1c7267b8 (patch) | |
tree | 21bc129793274c2a610642b3b0b10ea3743b1029 /py/asmthumb.c | |
parent | 3611dcc260cef08eaa497cea4e3ca17977848b6c (diff) |
py/asmthumb: Flush D-cache, and invalidate I-cache on STM32F7.
Tested on a STM32F7DISCO at 216MHz. All tests generating code (inlineasm,
native, viper) now pass, except pybnative/while.py, but that's because
there is no LED(2).
Diffstat (limited to 'py/asmthumb.c')
-rw-r--r-- | py/asmthumb.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c index 8341c958e..1aae3d38e 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -90,6 +90,15 @@ void asm_thumb_start_pass(asm_thumb_t *as, uint pass) { void asm_thumb_end_pass(asm_thumb_t *as) { (void)as; // could check labels are resolved... + + #if defined(MCU_SERIES_F7) + if (as->pass == ASM_THUMB_PASS_EMIT) { + // flush D-cache, so the code emited is stored in memory + SCB_CleanDCache_by_Addr((uint32_t*)as->code_base, as->code_size); + // invalidate I-cache + SCB_InvalidateICache(); + } + #endif } // all functions must go through this one to emit bytes |