STM32f4 + Keil uVision and new project setup build errors

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32f4 + Keil uVision and new project setup build error

Post by Tectu »

Sure, that sounds like a sane way to go.
ChibiStudio also features some custom plugins like to set the I/O pin modes etc. People here seem to love it.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32f4 + Keil uVision and new project setup build error

Post by Giovanni »

Question, but do the included Keil demos (unmodified) work for you?

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32f4 + Keil uVision and new project setup build error

Post by Tectu »

but do the included Keil demos (unmodified) work for you?

He said so in another post, yes:
The demo application compiles OK which is encouraging.


~ Tectu
motley
Posts: 24
Joined: Fri May 10, 2013 3:51 pm

Re: STM32f4 + Keil uVision and new project setup build error

Post by motley »

Tectu and Giovanni,

Thanks again for taking an interest..

For my part a more successful day's work really,

After much reading I installed ChibiStudio compiled the STM32F4407-Discovery demo project (13secs), just one warning:

main.c:167:1: warning: no return statement in function returning non-void [-Wreturn-type]


I used the ST-Link Utility and ST-Link to program/verify and all runs, well I haven't checked the output yet but I have flashing LEDs galore...

I use one of these http://www.wvshare.com/product/Open407V-D-Standard.htm as a baseboard - excellent value and supports the Discovery board well. In this case the JTAG port is very convenient.

Next step is to monitor the test data output on USART2 and start to learn how to use the OS. I have a couple of HD44780 displays kicking about for which I see someone has generously donated a driver - that will be a starting point for practice.

Once again thanks to the generosity of folk who contribute there time and expertise ton forums like this to help those like me who are less knowledgable I have been able to make what to me is good progress - top stuff :-)

Cheers,

Chris
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32f4 + Keil uVision and new project setup build error

Post by Tectu »

motley wrote:I have a couple of HD44780 displays kicking about for which I see someone has generously donated a driver

If you're talking about this one, there has been introduced a completely stand-alone module for driving that kind of displays.
In case of you got the GLCD together with the board you liked, there's also already an existing driver for that one.

And thanks for your nice words, I guess everyone here is giving his best :)


~ Tectu
motley
Posts: 24
Joined: Fri May 10, 2013 3:51 pm

Re: STM32f4 + Keil uVision and new project setup build error

Post by motley »

Joel,

The first one you mention was the one I saw but I like the look of the standalone module very much - co-owned by you I see :-)

I'm not sure if the budget will run to a full graphic display but I have seen some cheaper ones about recently so maybe...

Cheers,

Chris
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32f4 + Keil uVision and new project setup build error

Post by Tectu »

Should I know you from somewhere or did you found my name on the owners list?

You can get some very cheap TFT modules with touchscreen. For example, there are quite a few different SSD1289 driven 3.2", 320x240 touchscreen display modules for 16$ on ebay. 5" will cost you like 50$ and a 7" is around 75$.
Also, the TDISP module should work but I didn't try it out after the last contribution (I simply didn't found the time to get the hardware up again since I don't have a dedicated board for that). Please let me know if there are any issues.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32f4 + Keil uVision and new project setup build error

Post by Giovanni »

Hi,

That warning is known and accepted, it is present in most demos, the cause is that GCC complains about the following:

Code: Select all

int xxx(void) {

  while (1) {
  }
}


Since xxx is supposed to return "int" GCC complains even if the infinite loop obviously prevents the function from returning. The solution would be to write it like:

Code: Select all

int xxx(void) {

  while (1) {
  }
  return 0;
}


but in this case are the other compilers to complain, specifically Keil and IAR, because the "return 0" cannot be reached. Since GCC is minority I prefer to not put the "return" and accept the warning.

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32f4 + Keil uVision and new project setup build error

Post by Tectu »

That can be fixed:

Code: Select all

__attribute__((noreturn))

Not sure if this is GCC only (but at least the syntax will be, I assume).
But I agree with you, better say with a warning which is absolutely 100% not critical instead of making compiler dependent code and other nasty stuff.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32f4 + Keil uVision and new project setup build error

Post by Giovanni »

It is a non portable construct and I believe you can't apply it to non-void functions anyway.

Giovanni
Post Reply