MikroC and STM32 - Page 1
Forum section: electronics / general

author: Harvs
author_rank: Super Contributor
timestamp: September 15, 2013, 08:14:28 am
content: 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?

author: Bored@Work
author_rank: Super Contributor
timestamp: September 15, 2013, 08:37:27 am
content: 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.

author: Harvs
author_rank: Super Contributor
timestamp: September 15, 2013, 08:52:26 am
content: 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=52448Guess I'll move on. Keil you say, I'll check it out...

author: Unknown
author_rank: Unknown
timestamp: September 15, 2013, 09:02:32 am
content: 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.

author: Harvs
author_rank: Super Contributor
timestamp: September 15, 2013, 09:18:55 am
content: 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.

author: Spock
author_rank: Newbie
timestamp: September 15, 2013, 09:42:03 am
content: Hi,Take a look here:http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchainIt 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:C:\Programs\gcc-arm-none-eabi-4_7\bin>arm-none-eabi-gcc -print-multi-lib.;thumb;@mthumbfpu;@mfloat-abi=hardarmv6-m;@mthumb@march=armv6s-marmv7-m;@mthumb@march=armv7-marmv7e-m;@mthumb@march=armv7e-marmv7-ar/thumb;@mthumb@march=armv7armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16

author: notsob
author_rank: Frequent Contributor
timestamp: September 15, 2013, 09:51:45 am
content: AND dont forget - every time you use ARM / KEIL - $$ go to Apple - one of the original investors in ARM after ACORN

author: Harvs
author_rank: Super Contributor
timestamp: September 15, 2013, 10:33:48 am
content: 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 15, 2013, 10:47:16 am
content: 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.

author: andersm
author_rank: Super Contributor
timestamp: September 15, 2013, 11:08:23 am
content: Quote from: HackedFridgeMagnet on September 15, 2013, 10:47:16 amIt'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 atthe documentationtells us that the option you want is -Werror=implicit-function-declaration.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 15, 2013, 12:06:48 pm
content: Thanks I will certainly give it a try.edit: works nicely

author: dannyf
author_rank: Super Contributor
timestamp: September 15, 2013, 01:12:24 pm
content: 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.

author: dannyf
author_rank: Super Contributor
timestamp: September 15, 2013, 11:13:20 pm
content: QuoteThat ( 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.

author: Harvs
author_rank: Super Contributor
timestamp: September 16, 2013, 12:00:38 am
content: 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.

author: dannyf
author_rank: Super Contributor
timestamp: September 16, 2013, 12:32:56 am
content: When your livelihood depends on it, those free tools can be very expensive to use.

author: Unknown
author_rank: Unknown
timestamp: September 16, 2013, 02:23:15 am
content: 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.

author: andersm
author_rank: Super Contributor
timestamp: September 16, 2013, 02:55:09 am
content: Quote from: dannyf on September 15, 2013, 11:13:20 pmThat'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.

author: Unknown
author_rank: Unknown
timestamp: September 16, 2013, 03:07:38 am
content: 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.