EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Crossworks beginner

Started by normnet2003 February 17, 2011
Hi Aamir

--- 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???

Do you want to make a blinker?
Or a constant light?

If you want to make a blinker:

Setup (IOport);
REPEAT
SetBit (Led, 1);
Wait (200);
SetBit (Led, 0);
Wait (300)
UNTIL PigsCanFly;

It's up to you to fill in the procedures Setup, SetBit and PigsCanFly.

An Engineer's Guide to the LPC2100 Series

Hi Amir,

--- In l..., aamir shakoor wrote:
> By the way when we just power up the processor whats on its IO
> ports 0 or 1???

OK, I'm an old guy, but when I learned programming the Z80, I read the Z80 technical user manual, plus all datasheets for the support and the peripheral circuitry several times. Same for the 8086, PIC 16Cxx, AVR, Z8 and now the ARMs.

I guess you do the same. Look for sometjing like 'reset condition'. The datasheet holds it all. And if it doesn't, let me know, I know a few NXP engineers. :0)

After reading the datasheet you *KNOW* the chip. You *Know* what it can and what it might be able to do more. If the Arm is your first micro processor, go spend a few weeks in the datasheets. If you've done other processors before, just skim through the PDF files. In essence the ARM and the PIC are similar. The Arm is just a little bit more powerful. ;o)

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?)

>
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: l... [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?)
>
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: l... [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?)
>
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: l... [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?)
>

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.
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: l... [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?)

> >

>
On Fri, Feb 18, 2011 at 6:34 AM, 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.
Aamir, I was going to suggest that you take an existing IDE like LPCXpresso
et al. and check the demo projects for the CPU you are targeting. These are
proven pieces of code. Then, modify main() to fit your needs. ARM is not the
most straightforward architecture to get started, although it is a powerful
machine once you get used to it.

If you already have a working demo from a (past?) colleague, take the source
code and check the startup file (hint: exception vectors, thumb instruction
set, odd/even addresses, etc.). This may give you a first indication.

Getting started from scratch would take a significant amount of time and
frustration to get to a simple "while(1);" without the right tools.

Cheers
Olivier Gautherot
o...@gautherot.net

>
> --- 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 CrossConnectUSB JTAG last monday, hoefully
> will recieve it soon.br /> > > 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 br /> > >
> > --- 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
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > br /> > >
> >
> >
> >
> >
> >
> >
> >
> >
> > 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.br /> > 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:
> l... [mailto:
> l... ]
> On Behalf Of aamir shakoor
> > Sent: 17 February 2011 10:03 PM
> > To: l...
> > Subject: Re: [lpc2000] Re: Crossworks beginner br /> > >
> >
> > 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 PMbr /> > >
> > 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Âbr /> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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?)
> > >
> >
>
>
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.  

Memfault Beyond the Launch