cancel
Showing results for 
Search instead for 
Did you mean: 

Is not posible to use: "<",">" in stm32f0, keil v4?

angeliran
Senior

I´m using this:

  1. void definir_polaridades (void){
  2.  
  3. if (contar_valor_1_hsync<contar_valor_2_hsync){//DEFINIR POLARIDAD DE HSYNC
  4. polaridad_hsync=5;
  5. } else {polaridad_hsync=10;}
  6.  
  7. if (contar_valor_1_vsync<contar_valor_2_vsync){//DEFINIR POLARIDAD DE VSYNC
  8. polaridad_vsync=5;
  9. } else {polaridad_vsync=10;}
  10. }

Keil don´t give any error, and compiles, but, when i check the result, it don´t take the operation.

Will I have to do without the operation?

Thx in advance!!!

8 REPLIES 8

Likely some issue elsewhere with the variables.

Changed under interrupt?

Perhaps you can review a disassembly of the code generated by the compiler?

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

I use the variables in an interruption, does it have something to do with it?

angeliran
Senior

Ok, as you say, @Community member​ , it´s a bug in keil...

>> it´s a bug in keil...

Your case is not compelling.

>>I use the variables in an interruption, does it have something to do with it?

Things that should be volatile?

Optimization settings change behaviour?

Anything the pre-processor could be doing?

#defines ?

Can you look at the pre-processor output?

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

I don´t have a concrete answer, if, i do twice last function, it works, i always use global variables.

I use stm studio to check how the variables evolve, past the time, when i do what i say, it works.

I don´t know, how to made the pre processor output, maybe you say, what i do with stm studio?

>> i always use global variables.

Ok, but are they volatile? Should be if they change outside of normal program flow.

Unfamiliar with volatile keyword, https://www.geeksforgeeks.org/understanding-volatile-qualifier-in-c/

The compilation process occurs in several stages, the preprocessor deals with # operators, macros, etc. The output from this stage can be directed to a file in lieu of complete compilation, so you can inspect for actual vs desired behaviour.

https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_chr1383664717444.htm

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

No, it´s not volatile. I don´t know if keil is configured to make my code optimized... I don´t modify anything, i use it as default.

It's improbable that the compiler is this broken.

You're going to have to debug and diagnose what's really going on, and then fix/address that problem.

Perhaps use fromelf -csd test.axf >test.lst to generate a listing file you can inspect, and review the code generated by the compiler.

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