Skip to main content
ALevc.1
Associate III
June 13, 2020
Question

Compiler optimization for speed on STM32H747HI-DISCO

  • June 13, 2020
  • 2 replies
  • 796 views

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

This topic has been closed for replies.

2 replies

TDK
June 14, 2020

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
Principal III
June 14, 2020

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.