Author Topic: MikroC and STM32  (Read 10232 times)

0 Members and 1 Guest are viewing this topic.

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
MikroC and STM32
« on: September 15, 2013, 08:14:28 am »
Anyone using this combination?

I'm looking around for a new toolchain now as I need hard floating point on the M4F.

MikroC seems to have some nice features, but I can't work out what the deal with the libraries are.  There's obviously a bunch of stuff included, but it is significantly lacking compared to the std cmsis and peripheral libraries from ST.  To the point where anything outside of "Arduino" style levels of complexity requires you to manually work out how to configure all the bits in the configuration registers.  Case in point, there's no simple routine to set up the systick timer...

Trying to include that standard libraries from ST throws truck loads of errors that looks like it would require pulling the ST libraries apart to get them to work.

So I don't understand what the deal is.  Surely I'm missing something, why would someone put out a in-complete toolchain that's not compatible with the far more complete device libraries from the manufacturer?
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: MikroC and STM32
« Reply #1 on: September 15, 2013, 08:37:27 am »
The MicroE compilers I have seen were all of mediocre quality. They target the education market (and with their dev boards the poser market, too). If you need something professional look for stuff from e.g. Keil, not from a toy company.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: MikroC and STM32
« Reply #2 on: September 15, 2013, 08:52:26 am »
Yeah I just stumbled across the work around.  Not very nice and is still quite buggy even when you follow the directions.

http://www.mikroe.com/forum/viewtopic.php?f=178&t=52448

Guess I'll move on.  Keil you say, I'll check it out...
 

alm

  • Guest
Re: MikroC and STM32
« Reply #3 on: September 15, 2013, 09:02:32 am »
My impression of MicroE is similar to what B@W mentions: lots of (sometimes buggy) libs without source to get you started, but mediocre compiler quality that compiles all code to an intermediate language so they can support multiple front-ends (eg. MicroC, MicroBasic).

Keil is an excellent compiler (owned by ARM I think), but fairly expensive. GCC is also quite good. There are various commercial shrink-wrapped gcc+libs+IDE+support packages available from vendors like Atolic, Codered and Rowley if you don't mind paying a few hundred USD or so (for commercial licenses) to save you hours of messing around. Most (including Keil) have size-limited versions available for evaluation (or hobbyists).

Edit: remove unsourced statement.
« Last Edit: September 16, 2013, 03:04:55 am by alm »
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: MikroC and STM32
« Reply #4 on: September 15, 2013, 09:18:55 am »
I've been using Sourcery lite, eclipse and openOCD up to this point, but the lite and personal versions don't have hard floating point library support.  I'm happy to pay a few hundred, but the Sourcery standard edition (cheapest with floating point) is $1k, which is more than I'd like to pay.

I had a muck around with the GNUARM compiler yesterday, but it got frustrating because the ARM plugin for Eclipse doesn't seem to work properly with it.  Basically it seemed to muck up the make files when that compiler was selected.

So its worth it to save time at this stage to spend a "reasonable" amount on something that just works.  BTW I'm actually after an academic licence if available, it's for research.
 

Offline Spock

  • Contributor
  • Posts: 8
  • Country: pl
Re: MikroC and STM32
« Reply #5 on: September 15, 2013, 09:42:03 am »
Hi,

Take a look here: http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain
It is based on gcc  (linaro  tree i think) and you will have Linux and Windows binaries.

I'm using this one - it have HF support for CM4F family. I build with it for STM32F4 and TI TM4C with no problems.
Here is supported targets list:
Code: [Select]
C:\Programs\gcc-arm-none-eabi-4_7\bin>arm-none-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
fpu;@mfloat-abi=hard
armv6-m;@mthumb@march=armv6s-m
armv7-m;@mthumb@march=armv7-m
armv7e-m;@mthumb@march=armv7e-m
armv7-ar/thumb;@mthumb@march=armv7
armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16
armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16
armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16
armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16
 

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 644
  • Country: au
Re: MikroC and STM32
« Reply #6 on: September 15, 2013, 09:51:45 am »
AND dont forget - every time you use ARM / KEIL - $$ go to Apple - one of the original investors in ARM after ACORN
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: MikroC and STM32
« Reply #7 on: September 15, 2013, 10:33:48 am »
Thanks Spock, I'll check it out.

Well notsob, what do you do.  I'd prefer not to support the Coles/Myer group or Westfarmers, but I have to eat... Such is life.
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 1956
  • Country: au
Re: MikroC and STM32
« Reply #8 on: September 15, 2013, 10:47:16 am »
I have been using Yagarto 2012 which is some sort of GCC, called from eclipse C-C++ devel tools with the open debugger (ODB?) and some other plugin for inspecting the registers. It works well.
I use the ST libs. But only for M3 not M4 yet but I assume the M4 libs utilise the hardware floating point. I have an M4 chip ready to try when i get the chance as it should be pin compatible.

I have managed to get rid of all the errors except 2 nonsense ones which I can now safely ignore and all the warnings.
Its so important to be able to see the warnings as often they are important.
The warning I hate most is implicit declaration of a function, WTF it should be an error. Why would anyone implicitly define a function, sounds like script. I haven't figured out to to make this an error yet.
All lot of the errors are false and are to do with the ide and not the compiler. It is fixed by an eclipse setting.

Obviously it takes a bit to set up and learn but it is free as and it works. I am very happy with it.
I did have to fiddle with the make files, I think I took off the auto generate make files and used some fairly standard ones instead.

I did try the limited version of Atollic which is eclipse based, it was excellent but too much money for me.


 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1119
  • Country: fi
Re: MikroC and STM32
« Reply #9 on: September 15, 2013, 11:08:23 am »
The warning I hate most is implicit declaration of a function, WTF it should be an error. Why would anyone implicitly define a function, sounds like script. I haven't figured out to to make this an error yet.
It's still legal from a language specification point of view, due to backwards compatibility with pre-C89 code which didn't have prototypes. A quick look at the documentation tells us that the option you want is -Werror=implicit-function-declaration.

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 1956
  • Country: au
Re: MikroC and STM32
« Reply #10 on: September 15, 2013, 12:06:48 pm »
Thanks I will certainly give it a try.

edit: works nicely
« Last Edit: September 16, 2013, 04:50:00 am by HackedFridgeMagnet »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: MikroC and STM32
« Reply #11 on: September 15, 2013, 01:12:24 pm »
You can try Coocox's ide: it is entirely free, and fully supports the oem libraries and their own.

The backend is gcc-arm and the front-end is eclipse.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: MikroC and STM32
« Reply #12 on: September 15, 2013, 11:13:20 pm »
Quote
but mediocre compiler quality that compiles all code to an intermediate language so they can support multiple front-ends (eg. MicroC, MicroBasic).

That ( compiling to an intermediate language ) is how GCC works as well. I suspect that IAR does that as well, given the high number of platforms it supports.
================================
https://dannyelectronics.wordpress.com/
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1164
  • Country: au
Re: MikroC and STM32
« Reply #13 on: September 16, 2013, 12:00:38 am »
I tried out Keil's MDK last night.  Having only used open-source tools for the last couple of years with ARM, it's so nice to be able to just put some code together have it compile, download and work! None of the endless chasing obscure settings etc.

I think I'll see if I can get hold of an academic licence through the uni and be done with it.  Then again what I'm actually doing may even fit within the 32kB limit of the free version, I'm basically just churning through control loops at a high update rate.

Thanks for all the suggestions, it's appreciated.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: MikroC and STM32
« Reply #14 on: September 16, 2013, 12:32:56 am »
When your livelihood depends on it, those free tools can be very expensive to use.
================================
https://dannyelectronics.wordpress.com/
 

alm

  • Guest
Re: MikroC and STM32
« Reply #15 on: September 16, 2013, 02:23:15 am »
Yep, although the same is true for some commercial tools. Having a possibly buggy library without source (eg. the MikroE stuff) can also be very expensive. I don't want to count the number of hours I've wasted trying to get supposedly working commercial software to do its job. And about as much time trying to extract any useful information from the tech support people.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1119
  • Country: fi
Re: MikroC and STM32
« Reply #16 on: September 16, 2013, 02:55:09 am »
Quote
but mediocre compiler quality that compiles all code to an intermediate language so they can support multiple front-ends (eg. MicroC, MicroBasic).
That ( compiling to an intermediate language ) is how GCC works as well. I suspect that IAR does that as well, given the high number of platforms it supports.
That's standard compiler design. The code transformations performed during the compilation process would be nearly impossible otherwise, not to mention features like link-time code generation.

alm

  • Guest
Re: MikroC and STM32
« Reply #17 on: September 16, 2013, 03:07:38 am »
I'm familiar with the GCC design. What I learned about MikroE had produced more of a runtime overhead. However, I can no longer find a source for this statement, let alone details, so I've edited my original post to remove it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf