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

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

STM32f4 + Keil uVision and new project setup build errors

Post by motley »

Hi,

Day one with ChibiOS so apologies in advance, I have tried to follow the setup given for the new project but I get the following build output listing, clearly I have made a mistake or two.

Rebuild target 'Target 1'
compiling main.c...
compiling board.c...
compiling chlists.c...
compiling chschd.c...
compiling chthreads.c...
compiling chsys.c...
compiling chvt.c...
compiling chsem.c...
compiling hal.c...
compiling pal.c...
compiling hal_lld.c...
compiling stm32_dma.c...
compiling pal_lld.c...
compiling chcore_v7m.c...
os\ports\IAR\ARMCMx\chcore_v7m.c(69): warning: #223-D: function "__get_PSP" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(80): warning: #223-D: function "__set_PSP" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(133): warning: #223-D: function "__set_CONTROL" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(133): warning: #223-D: function "__get_CONTROL" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(136): warning: #223-D: function "__set_FPSCR" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(160): warning: #223-D: function "__get_PSP" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(165): warning: #223-D: function "__set_PSP" declared implicitly
os\ports\IAR\ARMCMx\chcore_v7m.c(175): warning: #223-D: function "__get_FPSCR" declared implicitly
compiling chcore.c...
compiling nvic.c...
assembling cstartup.s...
os\ports\IAR\ARMCMx\cstartup.s(28): error: A1163E: Unknown opcode MODULE , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(30): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(31): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(32): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(33): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(35): error: A1163E: Unknown opcode AAPCS , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(38): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(40): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(41): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(42): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\cstartup.s(43): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(44): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\cstartup.s(46): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(47): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(48): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\cstartup.s(50): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(52): error: A1163E: Unknown opcode EXTWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(53): error: A1163E: Unknown opcode EXTWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(56): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(57): error: A1493E: REQUIRE must be in an AREA
os\ports\IAR\ARMCMx\cstartup.s(59): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\cstartup.s(60): error: A1105E: Area directive missing
os\ports\IAR\ARMCMx\cstartup.s(60): warning: A1088W: Faking declaration of area AREA |$$$$$$$|
os\ports\IAR\ARMCMx\cstartup.s(63): warning: A1876W: Use of '|' as a synonym for the :OR: operator is deprecated.
os\ports\IAR\ARMCMx\cstartup.s(71): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\cstartup.s(72): error: A1167E: Invalid line start
assembling vectors.s...
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(28): error: A1163E: Unknown opcode MODULE , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(30): error: A1163E: Unknown opcode AAPCS , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(33): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(34): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(37): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(39): error: A1159E: Label missing from line start
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(41): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(42): error: A1105E: Area directive missing
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(42): warning: A1088W: Faking declaration of area AREA |$$$$$$$|
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(144): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(145): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(146): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(147): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(148): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(149): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(150): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(151): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(152): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(153): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(154): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(155): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(156): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(157): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(158): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(159): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(160): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(161): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(162): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(163): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(164): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(165): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(166): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(167): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(168): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(169): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(170): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(171): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(172): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(173): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(174): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(175): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(176): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(177): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(178): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(179): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(180): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(181): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(182): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(183): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(184): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
os\ports\IAR\ARMCMx\STM32F4xx\vectors.s(185): error: A1163E: Unknown opcode PUBWEAK , expecting opcode or Macro
assembling chcoreasm_v7m.s...
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(28): error: A1163E: Unknown opcode MODULE , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(30): error: A1163E: Unknown opcode AAPCS , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(40): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(41): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(42): error: A1163E: Unknown opcode SET , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(44): error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(58): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(59): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(60): error: A1105E: Area directive missing
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(60): warning: A1088W: Faking declaration of area AREA |$$$$$$$|
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(75): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(76): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(94): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(95): error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(96): error: A1167E: Invalid line start
os\ports\IAR\ARMCMx\chcoreasm_v7m.s(104): error: A1167E: Invalid line start
Target not created

Most of the errors seem to be in the assembler modules which is a bit outside my experience at the moment.

Any help about which direction to look would be gratefully received,

Thanks,

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 »

I don't use any IDE like Keil myself but three weeks back I set up a ChibiOS/RT + ChibiOS/GFX project for a friend in Keil. I followed this guide and I ended up without any problems. We used an STM32F407VGT for testing.

Please use the code boxes provided by this forum in order to post code snippets or compiler outputs in the future.


~ 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 »

Thanks for the reply - that is the guide I tried to follow - looks like I didn't follow it as well as I should, will have a read through again... The demo application compiles OK which is encouraging.

I assume the it's the 'Upload Attachment' tab that should be used for code snippets and the like ?

Cheers,

Chris
User avatar
Giovanni
Site Admin
Posts: 14892
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,

You can both upload code (zip files preferably) or post snippers using the "[code ]....[/code ]" tags, see the toolbar in the reply form. The result is like this:

Code: Select all

unsigned i = 12;


The code box is preferable for short code.

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 »

You didn't say that you can build the demos successfully in your first post. What exactly are you trying to build? Did you take the example/demo and modified it from there or did you try to start from scratch?


~ 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 »

Hi Tectu,

After downloading ChibiOS I read through the introduction documentation so as to understand what I was getting into. I then came across the document "How-To: Cortex-M4 (STM32F4xx) + ChibiOS/RT + Keil uVision" and followed it through as best I could. I think this is the one you kindly pointed me towards as well.

After I ended up with the build errors and made the post to this forum I tried the demo application and this compiles (I haven't tried to load it yet).

I have been working with the STM32f4Discovery board for a few weeks to see if it is suitable for my final year university project, my exploration of ChibiOS is part of that investigation. So far the STM32f4 seems OK for what I intend to do and reading through the ChibiOS documents it also seems to be worth the effort to learn more about. I don't have much experience of embedded RTOSs but you have to start somewhere.

I have clearly made a mistake in my setup for the test project and I will spend today going through it, if you can see where I have slipped up then all help gratefully received.

Best regards,

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 »

I'd love to give you some more pointers but I really don't know how to help there since I don't use keil.
You might want to know that there's something called ChibiStudio. It's a ready to download and use .zip containing a preconfigured eclipse and OpenOCD setup. Most people here seem to use that one with success. The question is if the GCC compiler it comes with is enough or do you really need/want to use the keil one.


~ 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,

The only reason I have for using Keil is that my supervising lecturer suggested it, by choice I would go with Open Source Software and I'm happy with GCC.

I will give the ChibiStudio a go and report back.

btw I did go through the settings again and I did find a couple of mistakes - but I still have the same build errors.

Thanks for your time,

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 »

I don't want to say that I have real experiences with keil but the few times I had to work with it, it was a pure pain. After eclipse and keil I decided not to use any IDE at all. This works especially fine with ChibiOS/RT since it's Makefile driven by default. A simple text editor, OpenOCD and make. There we go. Not sure if this is something for you but just that you don't tell us afterwards you'd have loved that option as well ^^


~ 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 »

Ahh more options - I'll probably have a go at both but Eclipse first to get used to the ChibiOS world and then see how it goes...

Cheers,

Chris
Post Reply