Page 1 of 1

Newbie help

Posted: Mon Oct 10, 2011 9:57 pm
by Kenneth E.
Hi,

First of all - thank you for a very excellent guide on how to setup eclipse and yagarto. I've completed most of the guide, but unfortunately I bought a Chinese manufactored O-link JTAG device (from an American site) which comes with more or less no support. Maybe some of you have an idea of what JTAG debuggers are nice and compatible - suggestions are welcome...

Anyway - I'm about to make a prototype which is based on the logomatic V2 from sparkfun (LPC2148). I only need to add 4 SPI devices to be logged, and some way of controlling it (I think SPI graphics display and some buttons). I will probably make my own PCB later on, so the LPC2148 may not be my final target - but for the prototype I believe it's fine.
The thing is, that I need an RTOS for the logging to be accurate, and decouple the UI tasks from the logging tasks.

I actually managed to get the CrossWorks IDE up an running with a FreeRTOS project (targetting logomatic) from another blog, but I keep comming back here, as Chibios looks more interesting to me - without beeing able to spot exactly why. Maybe it's the nice documentation, the very fast and benchmarked context switching, the feature set or what do I know - it just seems that I need to try this out (I guess you know the feeling).

Now the big question. I need to settle on an IDE and a JTAG device, and it seems that Eclipse with the GCC toolchain has a lot more features (like code discovery/completion and tons of plugins) than CrossWorks - however CrossWorks seems to be faster and lighter. I did have some annoyance in CrossWorks with configuring include paths and figuring out how the inheritable configuration system worked, but besides that it seems very responsive. As I'm going to make a commercial project, 1500 USD may not seem a lot. But I actually think it is quite a lot for an IDE, that compared to Eclipse seems to lack both in features, and more importantly doesn't support code discovery/completion - but maybe thats just me, beeing used to VS2010.

Anyway, I have now started to look into Eclipse as I could simply follow the guide found on your site, and at the same time get some more knowledge of Chibios.
But now I'm in doubt on what IDE I should go for. Should I go for Eclipse to be feature complete, CrossWorks for the responsiveness, IAR EW (I don't know the pricetag) or maybe something else - what do you think is better in the short/long run?

I think I've almost got Eclipse to work now, after including the Chibios files as linked directories, though I still need to figure out why Eclipse can't resolve the symbols NULL, _serial_driver_data, _serial_driver_methods, size_t, uint_fast8_t, uint32_t and uint8_t. The example project compiles fine, but Eclipse apparently needs some configuration to know about these types, as the compiler doesn't complain.

Sorry for this long and not so specific question. Feel free to move it to off-topic or similar.

Re: Newbie help

Posted: Tue Oct 11, 2011 7:40 am
by Giovanni
Hi,

Yes, I know exactly that feeling :)

That article will be updated soon, the Zylin plugin seems to have problems with latest Eclipse Indigo. It is possible to use the "GDB HW Debugger" as replacement of the Zylin without great changes.

About IDEs, I am just used to Eclipse, I also use other IDEs in order to run tests but for development I only feel at home in Eclipse because it is really an all-in-one environment.

About commercial Eclipse-based toolchains you may also consider CodeSourcery and CodeRed. The most popular commercial IDEs seem to be Keil and IAR but both are very expensive.
I think GCC+Eclipse is best overall, for example in both Keil and IAR compilers I haven't found an option to keep functions aligned on a flash page boundary (feel free to correct me) and that is bad for timings and predictability, GCC does have it and much more so surprisingly it appears to be better suited for embedded development than compilers designed for embedded development, code quality is excellent too.

The plain Eclipse debugger is missing some important features, the HW registers view for example, but there are open source plugins for this: https://sourceforge.net/projects/embsysregview/ (recommended, great plugin). Now it is also ChibiOS-aware thanks to the plugin included in latest versions.

Giovanni

Re: Newbie help

Posted: Tue Oct 11, 2011 6:56 pm
by Kenneth E.
Thanks for your reply. I've looked at both commercial eclipse platforms, but as a newbie it's hard for me to evaluate the features, as I have very little experience in the current embedded world. Actually I'm educated in embedded systems, analog/digital circuit design and assembly/c coding - but I haven't used that for the last 20 years. But I've always loved it, but my destiny just turned in direction of dedicated software development. Now, I've got this idea for a new project that also includes hardware, and therefore I'm going back to my roots again - so to speak.

So at the moment I'm in sort of a tooling phase, where I need to settle for a SW environment (+debugging) and I have spend around $3000 on some basic stuff like HW oscilloscope, ARM boards, components and soldering tools etc. to get started with the prototype.

I think I will try to stick with a free GCC+Eclipse toolchain until I know a little more about embedded development. I have already spend to much on HW devices that I probably won't need, so I'm glad that you wrote about your experiences so I do not make to many mistakes along the way :-)

Which JTAG device will you recommend for the GCC+Eclipse environment?

It seems that Olimex is quite popular, but I'd like not to buy one thats unsupported/incompatible if I choose to change environment some time.
Also the logomatic board is not having a JTAG header, but 6 pins that I'm a little unsure about (I think it's called SWD, but I'm not sure). I'm actually neither sure of wether this board is good for development, or is more like a customizable logger that people just tweak, without ever going into debugging the device. Maybe I should try with a bigger board including a JTAG header. Well, as you can tell there's still a few loose ends on my route to embedded development, so maybe I should hire a mentor or something like that - are you available/affordable :-)

Re: Newbie help

Posted: Tue Oct 11, 2011 7:06 pm
by Giovanni
Hi,

I use an Olimex ARM-USB-OCD and it gave me no problems, now they have improved high speed versions, I would go for one of those.

About SWD, most cheap JTAG adapters do not support it but Olimex now has an SWD adapter that can be added:

http://www.olimex.com/dev/arm-jtag-swd.html

The problem is that OpenOCD does not support SWD yet (but they are working on it), thus I would go for a board with the standard JTAG connector. Olimex has a lot of them and many are directly supported by ChibiOS, this one for example (it is the board I use mostly):

http://www.olimex.com/dev/stm32-p103.html

Or this one with LPC2148:

http://www.olimex.com/dev/lpc-p2148.html

Personally I would skip ARM7 and go for the Cortex-M3, it is more modern, ARM7 is almost obsolete now.

Giovanni

Re: Newbie help

Posted: Tue Oct 11, 2011 8:50 pm
by DrunkenDonkey
Thumbs up for http://www.olimex.com/dev/stm32-p103.html using it now, very well suited for development, especially with the handy extender place to wire all your custom stuff on.
The JTAG however... I have tried and worked for a week with Olimex's high speed JTAG http://www.olimex.com/dev/arm-jtag-ew.html and either I don't know how to set it up correctly or something, but it is more than 10 times slower than J-LINK edu I tried, often a single stepping over more complex stuff takes up to a minute, while almost instant on the j-link. OpenODC 5 could not run at all on it, there are enough posts on the topic, 4 worked, but...

And since we are on that topic, is yagarto or Sourcery G++ Lite toolchains better?

Re: Newbie help

Posted: Tue Oct 11, 2011 9:05 pm
by Giovanni
The ARM-OCD-USB is not slow, probably there is something wrong in OpenOCD with the model you have. It is designed for the IAR workbench, probably it is best used in that environment.

I normally use YAGARTO because it is "standard" GCC and that is important for testing, CodeSourcery often has improvements to the compiler not yet ported to the mainline GCC (they are GCC contributors), usually you can use them interchangeably and there is no reason to not have both (you just have to switch paths).

Giovanni

Re: Newbie help

Posted: Tue Oct 11, 2011 9:22 pm
by DrunkenDonkey
Thanks, I'll look around for another olimex jtag to try. Speaking of keil/iar - I can't for the life of me figure out why they are so expensive. I had the "pleasure" to work a bit on both recently, hell, even notepad++ makes up for a better ide, they look and work like a pro editor in the 90s should work and the incredibly messed and broke autocomplete (especially iar) made me giggle. Sure, having an arm simulator built in may be worth something, tho with jtag that can load the sw in 1 sec and simulators having lots of drawbacks, I don't really see it being used a lot.

Tl;dr - eclipse (helios sr2) + yagarto/codesourcery + cdt-master-7.0.2 + http://gnuarmeclipse.sourceforge.net/updates/ + chibi + and you are rocking ;)
There are ofc other compilations, some work better, some worse, I had some issues with latest eclipse so went back to helios

Re: Newbie help

Posted: Tue Oct 11, 2011 11:01 pm
by Badger
I've been using Summon Arm Toolchain and I find it works very well. I haven't had much luck with setting up Eclipse, although I did get it working with JTAG in an older version a while ago.. I have a Bus Blaster for JTAG. For me, it would be helpful if someone posts their experience at getting debugging working with the latest Eclipse, as I tried for a day and did not manage it! worked with an older version though.. I can't remember if I posted about it on here, but the main issue was that the code auto-discover stuff couldn't seem to understand the chibios structure, whereas helios worked fine.

Re: Newbie help

Posted: Tue Oct 11, 2011 11:15 pm
by Kenneth E.
Thanks again for your inputs, I really appreciate it.

I have now ordered the high speed Olimex JTAG adapter and the SWD adapter. I also ordered the LPC-2148 prototype board.

As I don't know the difference between ARM7 and Cortex-M3 I Googled it, and the first result was this one:
http://www.fivemanconspiracy.com/node/22

I don't bring this to counter your assesment, but I'm not experienced enough to see the big difference in terms of "quantum leaps" from the old architecture to the new one. I must also admit that I didn't read any other results, but I did seem to notice the price tag on the CPU's, which can be significant in a larger scale production (I'm hoping for 10000+ units). Anyway, the reason that I went for the LPC is that I already have the firmware bootloader (which I need for future customer updates) and the USB client (to FAT16 on the SD card) working out of the box from sparkfun (including schematics). So as a newbie, I hopefully won't have to struggle with this stuff by going for another architecture/brand (though it might be easier than I think to implement on the Cortex-M3).

So this is really great, and I'm looking forward to receive the package from Olimex.

I have to say thanks again, for guiding me in the right direction :-)

Re: Newbie help

Posted: Wed Oct 12, 2011 11:59 am
by Giovanni
From my experience:

ARM7 runs code or in ARM mode or THUMB mode:
ARM - Speed 100%, code size 150%.
THUMB - Speed 70%, code size 100%.

Basically you have to chose speed or size.

Cortex-M3 runs code only in THUMB2 mode:
THUMB2 - Speed 120%+, code size 90%.

It is faster at equal speed (it equates to lower consumption) and the code is more compact at same time (less flash, less die space, less $).

In addition to the above the peripherals in newer SOCs are generally more advanced compared to previous generations.

Giovanni