cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler optimization for speed on STM32H747HI-DISCO

ALevc.1
Associate III

Compiler optimization for speed on STM32H747HI-DISCO board destroys accessing external flash in memory mapped mode. Works fine without optimization but I get a hardfault as soon as I try to access memory from 0x90000000 after memory mapped mode is switched on.

Does anybody knbow why it happens? I'll appreciate hints for work around too 🙂

Best Regards;

Anton

2 REPLIES 2
TDK
Guru

Experiencing a bug only when optimizing the code usually indicates there is a bug in the code that simply isn't a problem when unoptimized. Could be any number of things. Assuming uninitialized memory in zero. A race condition failing due to the increased code speed. Debug the hard fault, find out where it's occurring exactly and what's causing it.

If you feel a post has answered your question, please click "Accept as Solution".
Piranha
Chief II

From a firmware code perspective CubeMX, HAL, BSP and C++ on a dual core H7 is probably the worst possible combination in a STM32 world! 😉 The amount of flaws in that pile of non-working bloatware developed by brainless code monkeys is so overwhelming that it's much easier and faster to develop all the necessary code on your own.