Maker Pro
Maker Pro

8051 on-chip debugging

A

Arlet Ottens

Jan 1, 1970
0
GCC + Eclipse are completely free. Nobody is charging you for using
them. Yes it takes time to learn to use Eclipse as does any IDE. The
real beauty of Eclipse is that you only need to learn it once and you
can use it with almost any language on any platform. I've used Eclipse
to debug C/C++ code and PHP. It works exactly the same.

The commercial IDEs/compilers also take time to learn, so there's not
much difference. Some of the IDEs are also very poorly made, such as
Microchip's MPLAB.

I've programmed H8, AVR, various ARM flavors, x86, MIPS, and PIC, all
using GCC. The time invested in learning the GCC tricks has paid off
multiple times.
 
The first thing to do is to analyse the original source code and compare
against required spec. A lot of early 8 bit projects were written at
least partly in asm and the coding standards, commentary and docs were
often poor or non existent.

You got that right!
The overall structure is often poor as well.

Bingo. Spaghetti doesn't even start to describe it. There is a *ton* of dead
code in there too. The device is trivial, but firmware isn't my call. I do
hardware.
If you can't work out how the parts of the code relate to each other, or
build the big picture, ie: you don't really understand how it works,
then you can't have confidence that any mods or additions won't break
something or introduce bugs.

You're preaching to the choir.
Analysing old code can be a very, very time
consuming business, even if there are docs, because docs never tell you
the whole story, for example, critical timing loop horrors and other
undocumented dependencies, buried deep within the code. It's all made
worse by the cavaliar use of global variables, making it difficult to
analyse what's peeking or poking what. Open source tools like doxygen
will generate call trees and variable lists and are really valuable if
you are trying to make sense of an old code base.

I don't want to sound pessimistic, but clients will often say "we just
need these few mods", thinking it's simple, when gut feeling tells you
it will save time to scrap most of the old code and start again.

When the owner of the company says he wants to do something his way, he gets
to. I'm not going to argue about firmware. I get to do enough of that with
just the hardware.
Of course, you know all this already :)...

Yup. That's one reason I don't do code anymore. I have a severe case of
xenocryptophobia. ;-)
 
H

Hans-Bernhard Bröker

Jan 1, 1970
0
Its something like 7 levels.

Nowhere near.
Maybe its 5 maybe its 10. Anyway, it is
not much. It has been too long since I bothered to look at it.

Well, piece of advice: before you _repeat_ such claims, after having
been challenged about them twice, by two different people, maybe you
should go check on your facts first.
xram xrom iram?

Aren't pragmas.
Its not just function pointers but also pointers to variables and
structs lead to extremely bulky& slow code. Making all variables and
structs global is the only solution to keep your code running fast.

It's nowhere near _that_ bad.
And then try to have a pointer point to a string which can be in
internal ram, external ram or rom and use standard string functions
like strcpy, printf, etc, etc.

Then you just do that. The tools know how to deal with the trickiness
this entails. Better than you do, anyway.
 
N

Nico Coesel

Jan 1, 1970
0
Chris H said:
IF may be free to download but that is not the same thing. Ask you
project manager.

There is no project manager so tell me where I should send the money
if I use Eclipse.
 
??
Their C8051F340, shows 2 Uarts, SMbus, USB, 64KF, in a QFP48 package ?

No USB.
Perhaps their PDF selector guide is better than a search ?

I used their parametric search, clicked UART, USB, and I2C. I only see 28 and
32 pin packages. "Dig I/O" bar only shows between 21 and 25 I/Os.
 
N

Nico Coesel

Jan 1, 1970
0
ChrisQ said:
Don't argue with any of that, just that I don't have all the
infrastructure in place yet. That includes toolchain, function libraries
and all the other stuff that you gather over time as you work with an
architecture. Meanwhile, I need to earn a living, using the most
appropriate
and economic solutions, irrespective of current fashion status.

For someone with little or no prior experience and for small projects,
it would be faster and more cost effective to buy the si labs kits. The
simpler architecture is easier to get to grips with and the $50 to $100
kits get you up and running with working code within an hour.

In that case I'd go for TI's MSP430. I've used those for a while for
various projects.
 
D

Dombo

Jan 1, 1970
0
Op 26-Mar-11 22:17, Nico Coesel schreef:
There is no project manager so tell me where I should send the money
if I use Eclipse.

Unless your time is worth nothing the purchase price of a tool is only a
(small) part of its total cost.
 
N

Nico Coesel

Jan 1, 1970
0
Dombo said:
Op 26-Mar-11 22:17, Nico Coesel schreef:

Unless your time is worth nothing the purchase price of a tool is only a
(small) part of its total cost.

Then show me a tool which doesn't require time to learn how to use it.


Eclipse being free doesn't mean it is bad. Eclipse is funded by huge
companies like Nokia, IBM, SAP, Oracle, etc, etc. Its most certainly
not a hobby project. Eclipse has been specifically designed to aid
software engineers developing complex pieces of software. There are
many different IDEs and the majority of them are not very productive
to work with.

For most compiler vendors the IDE is not part of their core business
so they invest as little as possible in developing their IDE. Note
that many have already moved to Eclipse or will do so in the near
future.

Semiconductor manufacturers like to show off with simple IDEs to win
customers for their microcontrollers. Don't get fooled by shimmering
beads and mirrors. At some point you will want to take software
development to a next level and you'll find the simple IDE to be
inadequate (=time wasted on learning how to use it). Or you'll move to
a different platform (=time wasted on learning how to use the specific
IDE).

The whole point of Eclipse is to learn once and use it for all
languages on all platforms. The same goes for GCC (and binutils). GCC
works the same for all targets. If you know how to use GCC for an
MSP430 you know for 99.9% how to compile for LPC2000.
 

?? Pasted from their web site :
http://www.silabs.com/products/mcu/usb/Pages/default.aspx
C8051F340-GQ : [" USB 2.0, 2xUART, I2C, SPI, Ext Mem I/F "] 48-pin,
9x9, TQFP

I used their parametric search, clicked UART, USB, and I2C.  I only see 28 and
32 pin packages. "Dig I/O" bar only shows between 21 and 25 I/Os.

...Then don't use their 'parametric search' ;)\

...but it's such a neat tool! ;-)
{ Tho USB & 40 io seems to findn the 340 just fine from here.... ?}

It finds it fine if you click on USB MCUs, too. Dumb site.

I'll certainly look into it as a replacement for the Atmel part we're using.
$99 for the Dev Kit is certainly reasonable, too. Thanks!
 
C

Chris H

Jan 1, 1970
0
Nico Coesel said:
There is no project manager so tell me where I should send the money
if I use Eclipse.

Depends how you value your time.
 
C

Chris H

Jan 1, 1970
0
Nico Coesel said:
For most compiler vendors the IDE is not part of their core business
so they invest as little as possible in developing their IDE.

This is complete crap.
Note
that many have already moved to Eclipse or will do so in the near
future.

Again crap and conjecture not based on reality.
Semiconductor manufacturers like to show off with simple IDEs to win
customers for their microcontrollers. Don't get fooled by shimmering
beads and mirrors.

Iagree... This is why most silicon vendors do a GGC compiler so it is
"free" to use their MCU's. They don't give a damn about GCC or Open
source they just want the cheapest possible start up cost to get their
silicon in use.
At some point you will want to take software
development to a next level and you'll find the simple IDE to be
inadequate
In what way?
The whole point of Eclipse is to learn once and use it for all
languages on all platforms. The same goes for GCC (and binutils). GCC
works the same for all targets. If you know how to use GCC for an
MSP430 you know for 99.9% how to compile for LPC2000.

The answer to that is "badly"
 
C

Chris H

Jan 1, 1970
0
Nico Coesel said:
Some customer complaints for example:
http://www.keil.com/forum/14928/

Ok so you have one person wanting to use the Keil compiler with eclipse.
However I can probably fined many more who tell me Eclipse is crap.

You said: IDE is not part of their core business so they invest as
little as possible in developing their IDE

Which is complete crap. In fact Keil developed the IDE for their ARM
compilers BEFORE they did the compiler.


It would help if you could stop to read what was written. Freescale,
NXP, Renasas etc are silicon compnaies and are looking for the least
expensive way of getting the cheapest tools packaged with their silicon
to get people to try and use their silicon.

When they have decided on the silicon it is expected they will move on
to professional tools. The Tools packaged with the silicon are usually
coasted out of the marketing budget. A necessary evil

The problem is GCC, Linux and Eclipse tend to come with a religion
transplant that removes all engineering common sense.
 
D

Dombo

Jan 1, 1970
0
Op 27-Mar-11 1:55, Nico Coesel schreef:
Then show me a tool which doesn't require time to learn how to use it.

Strawman strategy. I never claimed that a tool (commercial or free)
doesn't require time to learn how to use it. I only claimed that the
purchase price is only part of its total cost. Therefore one should not
only look at its purchase price but also consider the time it takes to
get up to speed with it and the eventual productivity. And those factors
are certainly not equal for every tool.

I'm not saying that free tools costs more, just that it is not
self-evident that free tools cost less than commercial tools when you
look at the whole picture. Considering how much a manweek costs compared
to the purchase price of most tools, the purchase price should be in
most cases only a minor consideration.
Eclipse being free doesn't mean it is bad.

Strawman strategy. I never claimed it was.
 
C

Chris H

Jan 1, 1970
0
ChrisQ said:
With commercial toolchains set at the price they are, a lot of smaller
companies and consultants will have no alternative but to balk at the
cost and look for lower cost alternatives, especially if they need
multiple copies.

That is the same in every industry.
The gnu compiler collection and associated tools have
had some serious money invested by serious companies in the past few
years and are now probably every bit as good as the commercial versions
for some platforms.

That is not true by a LONG way.
Why is this ?. Because, as you say, the silicon
vendors want to get product into the marketplace and expensive
proprietary toolchains are one if not the main barrier to achieving this.

No. Silicon vendors put as little effort as possible in to developing
these tools It comes of their profit line

As you also say, nothing comes for free, but I could spend days at my
hourly rate and still save a bundle over, say. the Keil Mdk for
arm. Not only that, the experience gained building gcc and other tools
adds to the knowledge base and will be usable next time I need to build
a toolchain, not to mention the benefit in terms of common source
libraries, makefiles, linker script templates etc.

If you say so... I do know several people who costed it out and came to
the opposite conclusion.
That's a bit emotive, almost insulting, suggesting that any engineer who
doesn't keep the faith with commercial tools must be somehow mentally
deficient. Can't believe you really mean to say that.

I didn't say that at all. I use Open Source tools my self. I am just
not a fanatic about it.
 
J

John Devereux

Jan 1, 1970
0
ChrisQ said:
That's a pretty sweeping statement. How about some data to back it up ?.

He has none, just anecdotes, because it is, I gather,

*illegal to publish benchmarks of commercial compilers*.

What have they got to hide I wonder?

The one I remember is this notorious example

<http://www.compuphase.com/dhrystone.htm>

Here it seems Keil trashed GCC by comparing its output with
theirs. Without mentioning theirs had opimization turned on and gcc did
not!!

The only time I looked into it (on ARM) I found no significant
difference when compiling small functions and tight loops (which was my
focus when I needed to optimize something). There was a bigger
difference with respect to library functions and floating point math.

[...]
 
All you can do is form an honest opinion and communicate that that to
them. If they choose to ignore the facts, they can't say they were
not warned. Sometimes it's better to walk away from work if you can't
get the client to see sense.

This is an extension of an existing product. The issue is to have minimum
development investment. That, and the fact that he doesn't trust programmer's
time estimates. ;-)/2
I had to look that up :), but yes, dealing with someone else's legacy
code can be a soul destroying business...

I have enough problems dealing with other's hardware. Software?
Forgetaboutit.
 
C

Chris H

Jan 1, 1970
0
In message <[email protected]
s.com> said:
Wrong : The Raisonance toolkit has the same level of performance/
features, but has excellent support and less expensive !
My $.02,
Bruno

I know a company who bought the Raisionance (4 seats) According to
them there were so many bugs and problems they went out and bought the
Keil system to save the project. They said there was no comparison
between the 2 systems.

Also the Rasionance does not support anything like the same number of
8051 parts.
 
C

Chris H

Jan 1, 1970
0
In message <[email protected]
s.com> said:
Wrong : The Raisonance toolkit has the same level of performance/
features, but has excellent support and less expensive !
My $.02,
Bruno

I don't suppose you are a Senior Engineer Raisonance as the linked in
entry for Bruno Richard says?
 
C

Chris H

Jan 1, 1970
0
ChrisQ said:
And, I don't suppose you have any connection or interest in Keil or
Hitex either ?.

No interest in Hitex other than I used to work for them over 6 years
ago.

I can supply many compilers myself (over half a dozen brands including
GCC and Keil)
We all know that Keil C for 8051 is an excellent product, but you do
sound like and evangelist yourself sometimes. Slagging off any
company as you did in your last post is not what is expected from a
professional engineer...

I worked or many years as an Engineer using Keil compilers. I have used
them in depth on real high integrity development and know personally
many others who are pushing the 8051 family to it's limits.

We have also validated compilers for safety critical use.

However recently I have had to give support to some one with the
Resonance 8051 compilers who switched to Keil in mid project because of
the problems. I expect Bruno will be familiar with them. Though I don't
think this is the place to detail all the problems or the client.
 
Top