EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

[LPC2378] Is it possible to lose the bootloader?

Started by jdvoth November 12, 2008
Howdy,

I've been parachuted into a project using an LPC2378 and I have to
figure out why the micro will not program via the serial port or via
the JTAG port.

I've been studying the user manual and the flash magic docs so have a
running start.

I have been able to prove that my setup works using flash magic and a
Keil MCB2300 dev board. I know that DTR and RTS are controlling reset
and P2.10. I know that I can download a hello world program into the
MCB2300.

I have been scoping out my project board and I know that I have
control of reset and P2.10. I can see flash magic toggling them
whenever I attempt communications.

I am beginning to wonder if the NXP bootloader has been wiped out by
the previous programmer.

How can I tell if the bootloader is gone?
How can I tell if the code protection bits have been blown?
Have I missed something obvious?

Thanks Guys!

An Engineer's Guide to the LPC2100 Series

You could try erasing the device using SILL.

Ive got one LPC2368 back to life using SILL. Neither FlashMagic nor
Ulink2 Jtag could erase it. I dont know why, but SILL could.

You dont need to install Jayasooriahs bootloader on device, just
erase the device.

E.g. "sill -r com1"

You can download it from:

http://water.cse.unsw.edu.au/esdk/sill.html
Best regards,

____________________
Ivan Amancio

--- In l..., "jdvoth" wrote:
>
> Howdy,
>
> I've been parachuted into a project using an LPC2378 and I have to
> figure out why the micro will not program via the serial port or via
> the JTAG port.
>
> I've been studying the user manual and the flash magic docs so have a
> running start.
>
> I have been able to prove that my setup works using flash magic and a
> Keil MCB2300 dev board. I know that DTR and RTS are controlling reset
> and P2.10. I know that I can download a hello world program into the
> MCB2300.
>
> I have been scoping out my project board and I know that I have
> control of reset and P2.10. I can see flash magic toggling them
> whenever I attempt communications.
>
> I am beginning to wonder if the NXP bootloader has been wiped out by
> the previous programmer.
>
> How can I tell if the bootloader is gone?
> How can I tell if the code protection bits have been blown?
> Have I missed something obvious?
>
> Thanks Guys!
>

You dont need to install Jayasooriahs bootloader on device, just
erase the device.

I am missing Jayasooriah...
Warm Regards,

Mukund Deshmukh,
Beta Computronics Pvt Ltd.
10/1 IT Park, Parsodi,
Nagpur -440022 India.
Web site - http://betacomp.com

--- In l..., "Mukund Deshmukh"
wrote:
>
> You dont need to install Jayasooriahs bootloader on device, just
> erase the device.
>
> I am missing Jayasooriah...
>
>
> Warm Regards,
>
> Mukund Deshmukh,
> Beta Computronics Pvt Ltd.
> 10/1 IT Park, Parsodi,
> Nagpur -440022 India.
> Web site - http://betacomp.com
>

I have been successful in getting SILL and FlashMagic to work on my
target board.

The problem was not the bootloader. It was the power supply to the
serial buffer. The hardware was designed to shut off any unnecessary
devices if the micro was reset. Apparently the serial buffer chip
wasn't necessary!

Now I hope to figure out why the JTAG port isn't functioning properly.
It's probably a power thing too.

Thank you all for your ideas!

Hi Y'All,

I thought I would post a follow up just in case anyone else has the
same problems.

I finally got the JTAG interface working on my target board.

The root of the problem for me was the Oscillator Frequency setting.

I'm using Rowley CrossWorks and I was getting an error message "Loader
has not initialized correctly".

I read this webpage:
http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=80

The point of failure for me was this one:
A problem with the target that means the loader program is not
starting up correctly. For example, a possible cause of this might be
the target having a different clock configuration from the that of the
target the loader was developed for.

Once I went back through my schematic, I discovered that the processor
does not have a XTAL driving the X1/X2 pins. It has a complicated mess
of a circuit that isn't operational when the processor is unprogrammed.

I noticed that the processor has an RTC XTAL attached to the
RTCX1/RTCX2 pins so I took an intuitive leap and setup CrossWorks to
use that: "Project Properties -> Build Options -> Oscillator
Frequency" = 32kHz.

Well, what do you know? It WORKED! JTAG actually WORKED!

Hopefully, someone can benefit from my struggle.
--- In l..., "jdvoth" wrote:
>
> --- In l..., "Mukund Deshmukh"
> wrote:
> >
> > You dont need to install Jayasooriahs bootloader on device, just
> > erase the device.
> >
> > I am missing Jayasooriah...
> >
> >
> > Warm Regards,
> >
> > Mukund Deshmukh,
> > Beta Computronics Pvt Ltd.
> > 10/1 IT Park, Parsodi,
> > Nagpur -440022 India.
> > Web site - http://betacomp.com
> >
>
>
>
> I have been successful in getting SILL and FlashMagic to work on my
> target board.
>
> The problem was not the bootloader. It was the power supply to the
> serial buffer. The hardware was designed to shut off any unnecessary
> devices if the micro was reset. Apparently the serial buffer chip
> wasn't necessary!
>
> Now I hope to figure out why the JTAG port isn't functioning properly.
> It's probably a power thing too.
>
> Thank you all for your ideas!
>

That's not the way to "fix" your problem. Set the oscillator
frequency in build options back to whatever your crystal frequency
is. Then go into your target properties and set JTAG clock divider
to 10 or 12.

The issue with the LPC2378 is that the 4MHz internal RC oscillator
is the default oscillator coming out of reset and the JTAG clock
must be slowed down to work properly.

Jeff

--- In l..., "jdvoth" wrote:
>
> Hi Y'All,
>
> I thought I would post a follow up just in case anyone else has the
> same problems.
>
> I finally got the JTAG interface working on my target board.
>
> The root of the problem for me was the Oscillator Frequency
setting.
>
> I'm using Rowley CrossWorks and I was getting an error
message "Loader
> has not initialized correctly".
>
> I read this webpage:
> http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=80
>
> The point of failure for me was this one:
> A problem with the target that means the loader program is not
> starting up correctly. For example, a possible cause of this might
be
> the target having a different clock configuration from the that of
the
> target the loader was developed for.
>
> Once I went back through my schematic, I discovered that the
processor
> does not have a XTAL driving the X1/X2 pins. It has a complicated
mess
> of a circuit that isn't operational when the processor is
unprogrammed.
>
> I noticed that the processor has an RTC XTAL attached to the
> RTCX1/RTCX2 pins so I took an intuitive leap and setup CrossWorks
to
> use that: "Project Properties -> Build Options -> Oscillator
> Frequency" = 32kHz.
>
> Well, what do you know? It WORKED! JTAG actually WORKED!
>
> Hopefully, someone can benefit from my struggle.
>
>
> --- In l..., "jdvoth" wrote:
> >
> > --- In l..., "Mukund Deshmukh"
> > wrote:
> > >
> > > You dont need to install Jayasooriahs bootloader on
device, just
> > > erase the device.
> > >
> > > I am missing Jayasooriah...
> > >
> > >
> > > Warm Regards,
> > >
> > > Mukund Deshmukh,
> > > Beta Computronics Pvt Ltd.
> > > 10/1 IT Park, Parsodi,
> > > Nagpur -440022 India.
> > > Web site - http://betacomp.com
> > >
> >
> >
> >
> > I have been successful in getting SILL and FlashMagic to work on
my
> > target board.
> >
> > The problem was not the bootloader. It was the power supply to
the
> > serial buffer. The hardware was designed to shut off any
unnecessary
> > devices if the micro was reset. Apparently the serial buffer chip
> > wasn't necessary!
> >
> > Now I hope to figure out why the JTAG port isn't functioning
properly.
> > It's probably a power thing too.
> >
> > Thank you all for your ideas!
>
Interesting.

I've tested out your suggestion. It does not work for me. Only the
32kHz oscillator frequency setting works for me. I have the JTAG clock
divider set to 10 already.

I realize that there ought to be side effects of changing the
oscillator frequency settings. It's on my todo list.

I've noticed that "Target Options ->Loader Parameter" inherits the
"Build Options -> Oscillator Frequency" setting. I should go and ask
Rowley if I can set the two differently without danger.

--- In l..., "ksdoubleshooter" wrote:
>
> That's not the way to "fix" your problem. Set the oscillator
> frequency in build options back to whatever your crystal frequency
> is. Then go into your target properties and set JTAG clock divider
> to 10 or 12.
>
> The issue with the LPC2378 is that the 4MHz internal RC oscillator
> is the default oscillator coming out of reset and the JTAG clock
> must be slowed down to work properly.
>
> Jeff
>
> --- In l..., "jdvoth" wrote:
> >
> > Hi Y'All,
> >
> > I thought I would post a follow up just in case anyone else has the
> > same problems.
> >
> > I finally got the JTAG interface working on my target board.
> >
> > The root of the problem for me was the Oscillator Frequency
> setting.
> >
> > I'm using Rowley CrossWorks and I was getting an error
> message "Loader
> > has not initialized correctly".
> >
> > I read this webpage:
> > http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=80
> >
> > The point of failure for me was this one:
> > A problem with the target that means the loader program is not
> > starting up correctly. For example, a possible cause of this might
> be
> > the target having a different clock configuration from the that of
> the
> > target the loader was developed for.
> >
> > Once I went back through my schematic, I discovered that the
> processor
> > does not have a XTAL driving the X1/X2 pins. It has a complicated
> mess
> > of a circuit that isn't operational when the processor is
> unprogrammed.
> >
> > I noticed that the processor has an RTC XTAL attached to the
> > RTCX1/RTCX2 pins so I took an intuitive leap and setup CrossWorks
> to
> > use that: "Project Properties -> Build Options -> Oscillator
> > Frequency" = 32kHz.
> >
> > Well, what do you know? It WORKED! JTAG actually WORKED!
> >
> > Hopefully, someone can benefit from my struggle.
> >
> >
> > --- In l..., "jdvoth" wrote:
> > >
> > > --- In l..., "Mukund Deshmukh"
> > > wrote:
> > > >
> > > > You dont need to install Jayasooriahs bootloader on
> device, just
> > > > erase the device.
> > > >
> > > > I am missing Jayasooriah...
> > > >
> > > >
> > > > Warm Regards,
> > > >
> > > > Mukund Deshmukh,
> > > > Beta Computronics Pvt Ltd.
> > > > 10/1 IT Park, Parsodi,
> > > > Nagpur -440022 India.
> > > > Web site - http://betacomp.com
> > > >
> > >
> > >
> > >
> > > I have been successful in getting SILL and FlashMagic to work on
> my
> > > target board.
> > >
> > > The problem was not the bootloader. It was the power supply to
> the
> > > serial buffer. The hardware was designed to shut off any
> unnecessary
> > > devices if the micro was reset. Apparently the serial buffer chip
> > > wasn't necessary!
> > >
> > > Now I hope to figure out why the JTAG port isn't functioning
> properly.
> > > It's probably a power thing too.
> > >
> > > Thank you all for your ideas!
> > >
>
Hi,

> -----Original Message-----
> From: l... [mailto:l...] On Behalf
Of
> jdvoth
> Sent: 18 November 2008 00:03
> To: l...
> Subject: [lpc2000] Re: JTAG, CrossWorks and LPC2378 now working!
>
> Interesting.
>
> I've tested out your suggestion. It does not work for me. Only the
> 32kHz oscillator frequency setting works for me. I have the JTAG clock
> divider set to 10 already.
>
> I realize that there ought to be side effects of changing the
> oscillator frequency settings. It's on my todo list.
>
> I've noticed that "Target Options ->Loader Parameter" inherits the
> "Build Options -> Oscillator Frequency" setting. I should go and ask
> Rowley if I can set the two differently without danger.

The Oscillator Frequency build option is there so that user code and the
library can be told how fast the crystal runs and, hence, can derive other
frequencies from it. The loader also needs to know what frequency the
oscillator will run at because that's a parameter to the IAP functions.

Generally, you would not set these up with different values.

If you have a CrossConnect then RTCK takes care of adapting the JTAG clock,
but that does not affect the parameters above at all.

Regards,

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors


The 2024 Embedded Online Conference