regarding this topic
http://forum.chibios.org/phpbb/viewtopic.php?f=2&t=286
i got similar problem. I am ready with porting STM32 Graphics Library to my Touchscreen based on a F4Discovery - Board.
My port was based onto the demo.c for this board. With existing compiler settings i got always exception in following statements:
Code: Select all
AddPageControlObj( (uint16_t)((LCD_Width / 11)*9.3), (uint16_t)((LCD_Height / 10)*1.8), pageLabel_0a, pageStart );
// AddPageControlObj( (uint16_t)269, (uint16_t)43, pageLabel_0a, pageStart );
pageLabel_0b = NewLabel( 3, (uint8_t*)"Presentation & Demo", GL_HORIZONTAL, GL_FONT_BIG, GL_Black );
AddPageControlObj( (uint16_t)((LCD_Width / 11)*10.4), (uint16_t)((LCD_Height / 10)*2.8), pageLabel_0b, pageStart );
after simplification i got following code with removing Optimization from compiler options -O2
following code causes an exception in line 2
Code: Select all
float fa = (320 / 11)*9.3;
int da = (uint16_t)fa;
float fb = (240 / 10)*1.8;
int db = (uint16_t)fb;
float fc = (320 / 11)*10.4;
int dc = (uint16_t)fc;
float fd = (240 / 10)*2.8;
int dd = (uint16_t)fd;
int de = da + db + dc + de;
i can avoid excepions by removing following compiler options:
# USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -mhard-float -mfpu=fpv4-sp-d16 -fsingle-precision-constant
USE_OPT = -ggdb -fomit-frame-pointer -falign-functions=16
# MCU = cortex-m4
MCU = cortex-m3
seems problems with the use of fpu are continuing...
does anybody have a solution ?