On Fri, Feb 18, 2011 at 5:27 PM, mjames_doveridge <
m...@googlemail.com> wrote:
> --- In l..., "fruttenboel" wrote:
> >
> > > // CrossWorks Tutorial
> > >
> > > #include
> > >
> > > void factorial(int);
> > >
> > > int main(void)
> > > {
> > > int i;
> > > for (i = 0; i < 10; ++i)
> > > debug_printf("Factorial of %d is %d\n", i, factorial(i)); //this line:
> invalid use of void expression
> > > return 0;
> > > }
> > >
> > > Norm
> > >
> >
> > Try to write this same program with gcc in Linux. If you get it working
> there, then 'port' it to the ARM.
> >
> > A general advice from me: DO NOT try to learn programming on a micro
> controller. Learn it on a PC. Only THEN take the step to the embedded
> systems.
> >
> > And: you LEARN the art of programming not in the IDE but in the DEBUGGER
> while single stepping.
> >
> > Just my two cents.
> > Spot on!
>
> Only trivial programs don't have bugs and, even then, it takes days of
pain
> to get them to link with the libs, startup stuff and download to the uC, at
> which point they usually head straight for an abort handler because of some
> erroneous IDE define, linker/locator script error or hardware issues.
>
> If you cannot debug, you cannot program. IMHO, debugging skills should be a
> compulsory tutorial in all IT courses.
>
> If you screw up your Windows/Linux code, the gigabytes of PC OS will either
> stop your thread/s with some sort of error text in a message box or you can
> look at the Task Manager/ps to see what's stuck/looping.
>
> A compiler running on a PC can blow through your source code, generate an
> executable, run it and issue an error box before you take your finger off
> 'F9', (or whatever). Four 4GHz CPU's, no waiting, .
>
> Your uC will leave you with a dead board with next to no useful information
> after minutes of cross-building, downloading etc. It is not
> time/cost-effective to learn computer languages on a uC development system.
>
> Rgds,
> Martin
>
>
>
Reply by mjames_doveridge●February 18, 20112011-02-18
--- In l..., "fruttenboel" wrote: >
> > // CrossWorks Tutorial
> >
> > #include
> >
> > void factorial(int);
> >
> > int main(void)
> > {
> > int i;
> > for (i = 0; i < 10; ++i)
> > debug_printf("Factorial of %d is %d\n", i, factorial(i)); //this
line: invalid use of void expression
> > return 0;
> > }
> >
> > Norm
> > Try to write this same program with gcc in Linux. If you get it working
there, then 'port' it to the ARM.
>
> A general advice from me: DO NOT try to learn programming on a micro
controller. Learn it on a PC. Only THEN take the step to the embedded
systems.
>
> And: you LEARN the art of programming not in the IDE but in the DEBUGGER while
single stepping.
>
> Just my two cents.
>
Spot on!
Only trivial programs don't have bugs and, even then, it takes days of pain
to get them to link with the libs, startup stuff and download to the uC, at
which point they usually head straight for an abort handler because of some
erroneous IDE define, linker/locator script error or hardware issues.
If you cannot debug, you cannot program. IMHO, debugging skills should be a
compulsory tutorial in all IT courses.
If you screw up your Windows/Linux code, the gigabytes of PC OS will either stop
your thread/s with some sort of error text in a message box or you can look at
the Task Manager/ps to see what's stuck/looping.
A compiler running on a PC can blow through your source code, generate an
executable, run it and issue an error box before you take your finger off
'F9', (or whatever). Four 4GHz CPU's, no waiting, .
Your uC will leave you with a dead board with next to no useful information
after minutes of cross-building, downloading etc. It is not time/cost-effective
to learn computer languages on a uC development system.
Rgds,
Martin
Reply by zero_atwork●February 18, 20112011-02-18
--- In l..., "fruttenboel" wrote: >
> Let's just hope you are not working on the guidance system of a nuclear
missile.
>
Don't panic, that's beyond reach. This missile would only be a threat
for his job(s)...
Reply by roelof 't Hooft●February 18, 20112011-02-18
On Fri, 2011-02-18 at 15:47 +0000, fruttenboel wrote: > And what does 'r8' mean? Resistor 8? Reet
in my language means
> something VERY different and it's not a nice word.
I was also wondering about that and came to the same
dutch word :-)
Due to the lack of a better discription : Turbo spelling, AARGH !
roelof
Reply by fruttenboel●February 18, 20112011-02-18
> WOHOOOO PAUL,Thanks it works. I did not define
start up from
> reset.
Beginners error nr 1.
> THANKS A LOTTTT.U cant imagine how happy I am, I was
so concerned about my job.
Let's just hope you are not working on the guidance system of a nuclear
missile.
The lot of us, we helped you out. We saved your butt. But what have you learned
from this all?
And what does 'r8' mean? Resistor 8? Reet in my language means
something VERY different and it's not a nice word.
Reply by aamir shakoor●February 18, 20112011-02-18
thankss
--- On Fri, 2/18/11, Donald H wrote:
From: Donald H
Subject: [lpc2000] Re: Crossworks beginner
To: l...
Date: Friday, February 18, 2011, 6:45 AM
--- In l..., aamir shakoor wrote:
>
> WOHOOOO Â PAUL,Thanks it works. I did not
define start up from reset.
> THANKS A LOTTTT.U cant imagine how happy I am, I was
so concerned about my job.
It does my heart so good to see such a young grasshopper be enlightened by the
ways of the RTFM.
If we can only bottle up his knowledge and exuberance, we could sprinkle it on
this group and have other young grasshoppers become enlightened in only 4 posts
instead of 20 posts.
Congratulations aamir !!
This is but the first of many tests for the for the young engineer.
Being able to read the sacred RTFM and understanding the nuances of insight held
within.
Being able to decipher Chin-lish, mis-placed nouns, and hidden typo graphical
land mines will be with you for the rest of your days.
Congratulations aamir !!
Good luck with your job(s).
don
Reply by Donald H●February 18, 20112011-02-18
--- In l..., aamir shakoor wrote: >
> WOHOOOO PAUL,Thanks it works. I did not define start up from reset.
> THANKS A LOTTTT.U cant imagine how happy I am, I was so concerned about my
job.
It does my heart so good to see such a young grasshopper be enlightened by the
ways of the RTFM.
If we can only bottle up his knowledge and exuberance, we could sprinkle it on
this group and have other young grasshoppers become enlightened in only 4 posts
instead of 20 posts.
Congratulations aamir !!
This is but the first of many tests for the for the young engineer.
Being able to read the sacred RTFM and understanding the nuances of insight held
within.
Being able to decipher Chin-lish, mis-placed nouns, and hidden typo graphical
land mines will be with you for the rest of your days.
Congratulations aamir !!
Good luck with your job(s).
don
Reply by valeklubomir●February 18, 20112011-02-18
Meanwhile you have figured it out. Good work.
My note. Examine the project options in details, the
SRAM usage (22800 SRAM 69%) is quit huge for such simple
application. What they put there?!?!.
Have fun with it.
--- In l..., aamir shakoor wrote: >
> I am using NXP-LPC2138 and it is ARM7TDMI-S, v4t architecture I have selected
the project properties acordingly. What else information do I need??? and how to
select the correct start up code then???And where to place the code I chose by
configuration "ARM Flash release". r8?I loaded a HEX file in flash. finding it
in ARM FLASH RELEASE folder after built.Memmory usage is (1784 Flash 0% and
22800 SRAM 69%).I have attached the HEX file.
> Board is hard-wired and works with other code that I get from
previous developer.
>
> --- On Thu, 2/17/11, valeklubomir wrote:
>
> From: valeklubomir
> Subject: [lpc2000] Re: Crossworks beginner
> To: l...
> Date: Thursday, February 17, 2011, 4:11 PM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi Aamir
>
>
>
> As I see, you are really beginner, let's say level 0 or less.
>
>
>
> Some points
>
>
>
> - as told earlier read the PDF, or some ARM documents. Currently there are
several ARM core version existing.
>
>
>
> - which type of ARM do you start with? Manufacturer, device ...? The startup
code must match the device. You use CrossWorks probably the startup code is
added by linker. But linker must know which device do you use. Startup code is
there to get the ARM to execute the 'main'.
>
>
>
> - By the way where the compiler/linker placed the code FLASH or RAM?
>
> becasue simulator does not care where the code is. it will be executed. But in
microcontroller the code must be in right place. Usually it is FLASH, but code
compiled for RAM can't be placed in flash.
>
>
>
> - Finally what you have loaded into microcontroler? You have presented only C
program. CrossWorks must have generated some executable/binary/hex file.
>
>
>
> - Last thing is your board, try to hard-wire the P0.5/P0.6 pins to get the
power on always. I can't even imagine how the controller can run when it is
not powered.
>
>
>
> Lubomir
>
>
>
> --- In l..., aamir shakoor wrote:
>
> >
>
> > 1 : I have already ordered CrossConnect USB JTAG last monday,
hoefully will recieve it    Â
soon.Â
>
> > 2 : I loaded it using MikroElektronika USB ARMprog (does it make any
difference??) The Instalation guys of my company use same and I have to make the
working for this flash loader even if there is any difference??.3 : I have not
read the start upcode, but what should I do with it even if I read????4 : OK I
will read FIQs from your helpdesk (rowley support page r8???).5 : I have read
the documentation, but I will do it again if you have this impression.
>
> > Thanks for response,looking forward to hear from you further.
>
> >
>
> > AAMIR Â
>
> >
>
> > --- On Thu, 2/17/11, Paul Curtis wrote:
>
> >
>
> > From: Paul Curtis
>
> > Subject: RE: [lpc2000] Re: Crossworks beginner
>
> > To: l...
>
> > Date: Thursday, February 17, 2011, 2:23 PM
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Â
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Here’s my set of conjectures:
 1.    Â
You don’t have a JTAG adapter so you can’t
debug the application on the
hardware.2.     You
loaded the program using Flash
Magic.3.     You
did not read the startup
code.4.     You did
not read the FAQs on our
helpdesk.5.     You
did not read the package documentation. Â Fixing (1) will bring you
the most benefit. If you don’t fix (1) there is
little hope of fixing other problems quickly. Â -- Paul.
 From: lpc2000 [mailto:l...] On Behalf Of aamir shakoor
>
> > Sent: 17 February 2011 10:03 PM
>
> > To: l...
>
> > Subject: Re: [lpc2000] Re: Crossworks beginner Â
>
> >
>
> >
>
> > Hi,I tried and looked it in crossworks simulator in debug mode.The
instructions work as expected, but when I flash it in processor it does not do
anything.
>
> >
>
> > --- On Thu, 2/17/11, capiman26061973 wrote:
>
> > From: capiman26061973
>
> > Subject: [lpc2000] Re: Crossworks beginner
>
> > To: l...
>
> > Date: Thursday, February 17, 2011, 1:07 PMÂ
>
> >
>
> > To make long story short, try the following changes:
>
> >
>
> > #include
>
> > #include
>
> > #include
>
> >
>
> > int main(void)
>
> > {
>
> > IO0DIR = 0x00000060; // Set direction of P0.5 and P0.6 as out put
>
> > IO0SET = 0x00000060; // Set P0.5 and P0.6.
>
> >
>
> > while(1);
>
> > }
>
> >
>
> > --- In l..., aamir shakoor wrote:
>
> > >
>
> > > Oook, I got your point, I set the pins and enter the while 1 and it will
stay 1 untill I clear again r8?? and entering in infinite loop will never clear
it and I get 1 at both pins as long as its powered r8???
>
> > >
>
> > > --- On Thu, 2/17/11, brian_myers888 wrote:
>
> > >
>
> > > From: brian_myers888
>
> > > Subject: [lpc2000] Re: Crossworks beginner
>
> > > To: l...
>
> > > Date: Thursday, February 17, 2011, 12:44 PM
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > ÂÂ
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > Well, don't drop it completely, just move your 3 lines of code before
it (you don't really want to do those over and over, right?)
>
> > >
>
>
Reply by Paul Curtis●February 18, 20112011-02-18
> WOHOOOO PAUL,
> Thanks it works. I did not define start up from reset.
> THANKS A LOTTTT.
> U cant imagine how happy I am, I was so concerned about my job.
Excellent. Now at least you know where to find some information for common
problems. Also, we do have a helpdesk which you could have also used.
Reply by aamir shakoor●February 18, 20112011-02-18
WOHOOOO PAUL,Thanks it works. I did not define start up from reset.
THANKS A LOTTTT.U cant imagine how happy I am, I was so concerned about my
job.
--- On Fri, 2/18/11, Paul Curtis wrote:
From: Paul Curtis
Subject: RE: [lpc2000] Re: Crossworks beginner
To: l...
Date: Friday, February 18, 2011, 1:29 AM
1 : I have already ordered CrossConnect USB JTAG last monday,
hoefully will recieve it soon. So you
don’t have any eyes to debug this with. 2 : I loaded it using
MikroElektronika USB ARMprog (does it make any difference??) The Instalation
guys of my company use same and I have to make the working for this flash loader
even if there is any difference??. There probably is no difference.
3 : I have not read the start upcode, but what should I do with it even if
I read???? You will be enlightened. Search for startup problems and
how to fix it. And pre-processor defines. Or read the source code
that is placed into the project under the System Files folder. 4 : OK I
will read FIQs from your helpdesk (rowley support page r8???). Not FIQs,
FAQs. 5 : I have read the documentation, but I will do it again if you
have this impression. If you had read the documentation, you would know
what was wrong and how to fix
it. Start with the source code and read the FAQs. -- Paul.