Skip to main content
flyer31
Senior
December 2, 2018
Question

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

  • December 2, 2018
  • 1 reply
  • 532 views

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; } 

This topic has been closed for replies.

1 reply

Amel NASRI
Technical Moderator
December 24, 2018

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 "Best Answer" on the reply which solved your issue or answered your question.
Tesla DeLorean
Guru
December 24, 2018

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 VenmoUp vote any posts that you find helpful, it shows what's working..