cancel
Showing results for 
Search instead for 
Did you mean: 

"Cache New" Nut My_system_stm32h7.c file for Clock config: 4 Lines too much

flyer31
Senior

Sorry, I just recognized that in the file I appened to the "Cache New" Nut question, I kept 4 test lines to get this "Code 32 alignment" done before the for wait loop ... .

But this does not work ... this will unfortunately be refused by the compiler.

So please change this in line 192..200:

Wrong state:

//  __asm("ALIGN 32\n");
  iDelay= 0;
  __asm {
    AND iDelay, iDelay, #0
    ALIGN 32
    
  }
  while( !(PWR->D3CR & PWR_D3CR_VOSRDY))
  { if( iDelay++ > IFLOOPEND_1ms) return 0; } 

Correct it should look like this:

  iDelay= 0;
  while( !(PWR->D3CR & PWR_D3CR_VOSRDY))
  { if( iDelay++ > IFLOOPEND_1ms) return 0; } 

2 REPLIES 2
Amel NASRI
ST Employee

Hello @flyer31​ ,

Could you please precise where exactly is this code? which compiler are you using?

Thanks,

Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

It was Keil, using functionality not supported by the in-line compiler, and require changes in the segment alignment settings in a .s file. These questions were cross-posted here http://www.keil.com/forum/64067/arm-code-alignment-for-stm32h7-flash-access-loops/

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