PDA

View Full Version : teensy3 with IAR's IDE/compiler



stevech
06-21-2013, 07:12 AM
IAR's IDE and compiler are popular among professionals in the microprocessor world.
The limited code size version of it is free. The unlimited size is too expensive for a hobbyist.
Same for Keil's similar IDE compiler.

Anyway, I spent time getting the Teensy3's K20DX128 configured into the IAR. Freescale has a large amount of demo source code, and there are startup and linker files ready to use. I did get the blinky LED demo to run (.hex file from IAR sent to the Teensy flash loader program in windows). I almost have a more complicated demo from Freescale running on the K20. Nice clean well done code, well organized. Most of the demos are for Freescale's development boards which don't use a K20. But it's not hard to change that. E.g., the IAR IDE has a pop-up for which ARM MCU (all the vendors are there). It then generates the startup file and linker file, etc. There's a USB serial end point demo too.

This is going off the Arudino track, but I wanted to see if this can work easily, as the Arduino kit is a bit worrisome to me, in terms of bugs (not Paul's code).

I may be the only one here interested in using IAR due to its limitations in the free version and it's cost for the unlimited version, so this is just FYI.
Rowley's IDE for GCC/Arm is worth considereing - low cost. But it doesn't get the huge amount of free code that comes with IAR and Keil.
Freescale's own CodeWarrior might be good, but costly too.
I've used IAR for years and its familiar. They just updated it so it has most of the nifty tools in MS Studio for code navigation.

Bjoern
06-23-2013, 12:38 PM
IAR's and Keil's tools are nice and free if you can live with the code size limit.
I switched to emIDE recently, which is a free Open-Source, GCC, GDB and Codeblocks based tool chain.
Very happy with it. Would not want to go back to IAR.
See www.emide.org.
You may also want to look at emblocks.org. Seems equally good, but have not used it so far.
It is 2013 and it is time to no longer pay for a usable & free tool chain for embedded development!

PaulStoffregen
06-24-2013, 11:32 PM
I haven't used IAR much, but I did play with it briefly in the very early days of evaluating the Freescale Kinetis chips... which led me to the decision to use one for Teensy3.

For me personally, aside from the cost, a big obstacle to really trying IAR much is the lack of any Linux version.

For Teensy as a platform, I'm committed to supporting Linux and Mac as well as Windows.

stevech
06-24-2013, 11:59 PM
makes sense.

After fooling with IAR for the K20, unsuccessfully, I tried to get Eclipse with the ARM and Kenetis plugin working. OMG, I've used Eclipse before, for a complex Python project and I see Eclipse as a bigger mess than ever. When I found the long 100 step procedure to try to get it to work with T3, I gave up. Each project, I say "I'll never get near Eclipse again!", for embedded.

Really, I just want/need the nice Editor that indexes and parses ALL of the code, libraries from .h, and so on. So I can get the hints on function call params, and the "go to definition" and so on. I don't even care that much about breakpoint debugging.

I tried adapting the T3 code for initializing the K20, but using emIDE+GCC/G++, and also it's brother, EmBlocks. Mostly obvious, but the spelling differences between Kenetis' .h files and those in the T3 were a struggle. I did get it to compile but it hangs in one of the loops, after the PLL startup.

The best scheme would be to adapt the Kenetis Tower board K40 sample code, to run on a K20. I spent a lot of time on that. But their K40 uses an 8MHz crystal and I haven't learned which dividers (sysint) and the like, need changing to what. I think I did get the PLL changed from 8MHz to 16MHz crystal. But I gave up on this approach too.

I'm now back to the Arduino IDE with multiple tabs and that odd scheme they use for compiling the library source on first startup, then concatenating all the application source. That spoils the concept of modular programming, scope rules, and so on. Not to mention my desire for the indexing editor.

I can't expect too much from T3; it is what it is. The marketplace has nothing like it for NXP or Atmel M3 or M4. I've had an mbed for since they were new; it could have been good, but pooped out for lack of good libraries, especially Ethernet/IP.

NXP's documentation was much better than Freescale's, I find. Makes a big difference.

Enough rambling... I'll eventually find the right mix.

PaulStoffregen
06-25-2013, 12:47 AM
I'm now back to the Arduino IDE with multiple tabs and that odd scheme they use for compiling the library source on first startup, then concatenating all the application source. That spoils the concept of modular programming, scope rules, and so on. Not to mention my desire for the indexing editor.


All the .ino and .pde files are concatenated together.

However, you can put .cpp and .h files into the directory and they will appear as tabs in the Arduino editor. They are compiled normally, as separate files, not concatenated together with the .ino and .pde files.




Really, I just want/need the nice Editor that indexes and parses ALL of the code, libraries from .h, and so on. So I can get the hints on function call params, and the "go to definition" and so on. I don't even care that much about breakpoint debugging.


I hear this request a lot. I must confess, I've not used modern version of Visual Studio or other IDEs that do this. Do they all pretty much follow what Visual Studio does?

It'll probably be a few months, maybe several, until I put major effort into the Arduino IDE. But then again, if there's already some open source project that provide much of the parsing and back-end work, maybe this could turn out to be easier than the huge project it seems?

stevech
06-25-2013, 04:10 AM
Visual Studio is the Top Of The pile due to MS's investments. It's a bit close to Eclipse in feature bloat. Best suited for Windows app developers using C# (yuck).
The old editors that don't parse and index - are really inferior today. I used vi and Sun OS and so on for many years. It's all we had. The newer editors such as Programmer's Notepad or Notepad++ are better, in that they color-highlight and have better multi-file keyword search. But they are just a small step from vi and emacs of old.
The IDEs as in Keil and IAR are really superb for embedded developers. But not hobby-priced. The $3K or so for Keil or IAR (as I have used for years) with flash breakpoint debuggers (J-Link) improved my productivity 10-fold. Thus their price is well worth it, considering what I and my peers cost our corporations per hour with overhead and fringe that double our cost vs. salary.

So emIDE and Code::Blocks and a few others are close enough and free. In many ways, I think they make embedded easier for the novice than Arduino's IDE. But I'll not overlook Arduino's success with the non-geeks. But like bicycle training wheels, users that elect to stick with it, quickly outgrow it.

If I knew the K20 better (like I do the LPC2xxx), I could get this going in 1-2 days. I just don't know all the nuances of the the PLL and the dividers to setup the CPU. That done, and running, we're off and running with all the GCC/G++ function libraries for C/C++. Some of the T3 libraries go away. Many others need minor tweaks and/or ifdefs so the library can compile for the traditional IDE (emIDE et al) or the Arduino way for small projects, say, 300 lines of code or so and not modular.

These embedded-oriented IDEs with the smart editors are like the difference between vi and MS word with styles, in the document writing sense (not that I love Word, but I mean that tier vs. just bare bones editing).

PaulStoffregen
06-25-2013, 05:43 AM
Yes, but what specific editor features are you talking about?

Or let me ask it this way.... if someone crazy were to try bringing a few of these features to the Arduino editor, other than breakpoints/debug, which should be first on the list?

stevech
06-25-2013, 06:30 AM
Of course, I'd say use one of the other IDEs.
IMO, the editor needs what the others have...
Cursor on symbol or function name; right-click and there's a menu with lots of choice, such as Find All occurrences in all source and .h files, displayed in a list. Click the list member, editor jumps to that file and line. Or on the menu is Go to definition, or go to declaration. And if a function name, it looks up the signature(s) and a pop-up displays the function prototype. These sorts of things are in most IDEs. And many more.

emIDE or emBlocks are free and easy to install/deinstall and their samples can show these concepts. As can Atmel Studio for ARM/AVR.

duff
06-25-2013, 10:49 PM
Yes, but what specific editor features are you talking about?

Or let me ask it this way.... if someone crazy were to try bringing a few of these features to the Arduino editor, other than breakpoints/debug, which should be first on the list?

I think code folding would be one i would like to see. I hate all the scrolling i have to do when debugging a long program.

linuxgeek
06-26-2013, 07:01 AM
Code completion with the list of possible functions to call, and hovering over the function pops up the documentation associated with that function. Whatever the hell that's called. And the option to bring up the declaration of the function is nice.

For the weekend arduino code warrior (really who the arduino IDE is targeted towards) like myself, that's really all that's needed because I can't remember what things are called, or exactly what things do when dropping in for a hour or two to play around. That alone would drop the # of posts on arduino sites.

MichaelMeissner
06-26-2013, 12:38 PM
To me, it does not matter. While I can use other editors, Gnu emacs is firmly embedded in my muscle memory, and over the years, I have lots of extra lisp functions added to the emacs environment (such as asking to check in CVS files). For finding functions, I use the ctags facility within emacs, and failing that, grep is my friend. Call me an old school dinosaur.