Any way to launch ISP ?
2004-11-18 by dave_albert
Yahoo Groups archive
Index last updated: 2026-04-28 23:31 UTC
Thread
2004-11-18 by dave_albert
Is there any way to launch the ISP software without having the BSL jumper on? (i.e. does it have an entry point that does not check P0.14?)
2004-11-18 by Robert Adsett
At 06:25 PM 11/18/04 +0000, you wrote:
>Is there any way to launch the ISP software without having the BSL
>jumper on? (i.e. does it have an entry point that does not check P0.14?)
I think the only other way it starts is if the checksum over the exception
vectors fails. Erasing the first flash sector should do it. I believe
someone has already done that in practice, I seem to remember a report to
that effect here.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, III2004-11-18 by Owen Mooney
Yup There shore is ! In the LPC2106 anyway. I dunno about the rest of them. But it requrires a reset of the micro! Use the IAP instructions to erase the first block of flash memory. Drop the supply and bring it up again, and the chip detects the lost of a valid program and automatically jumps to the ISP. I use this to update the firmware with P0.14 buried deep in a hunk of expoxy, but watch it, Once the ISP is running anyone can steal your program !! I use a very unlikely pass code in the operating firmware to do this. Owen Mooney Subject: Is there any way to launch the ISP software without having the BSL jumper on? (i.e. does it have an entry point that does not check P0.14?)
2004-11-18 by Richard
Here is some code that will invoke the bootloader which will read
P0.14 (after you have set it low) and initiate ISP.
Richard
/* ISP Invocation code Richard Soennichsen - Philips
Semiconductors */
/*
10/11/2004
*/
/* define the SFR addresses, this may already be handled in a header
file */
#define MEMMAP (*((volatile unsigned int *) 0xE01FC040))
#define IODIR0 (*((volatile unsigned int *) 0xE0028008))
#define IOCLR0 (*((volatile unsigned int *) 0xE002800C))
#define PINSEL0 (*((volatile unsigned int *) 0xE002C000))
#define VPBDIV (*((volatile unsigned int *) 0xE01FC100))
#define PLLCON (*((volatile unsigned int *) 0xE01FC080))
#define PLLFEED (*((volatile unsigned int *) 0xE01FC08C))
void (*bootloader_entry)(void); /* Declare the entry function */
unsigned long temp; /*Temporary
variable */
void init(void)
{
temp = PINSEL0; /* Connect RxD0 & TxD0 pins to GPIO */
PINSEL0 = temp & 0xFFFFFFF3;
/* Select P0.14 as an output and P0.1 as an input */
/* P0.1 is sampled to determine baud rate */
temp = IODIR0;
temp = temp | 0x4000;
temp = temp & 0xFFFFFFFD;
IODIR0 = temp;
IOCLR0 = 0x4000; /* Clear P0.14 */
/*
Disconnect PLL if you want to do ISP at crystal frequency.
Otherwise you need to pass the PLL freq when bootloader goes in
ISP mode.
cclk = crystal when PLL is disconnected
cclk = PLL freq when PLL is connected.
Disconnecting the PLL is recommended.
*pllcon = 0x0; / disconnect the PLL
*/
*pllfeed = 0xAA;
*pllfeed = 0x55;
*/
/*
Set the VPB divider to 1/4 if you application changes the VPBDIV
value.
The bootloader is hard-coded to use the reset value of VPBDIV
register
*vpbdiv = 0x0;
*/
/* Map bootloader vectors */
MEMMAP = 0x0;
/* Point to bootloader entry point i.e. reset vector 0x0 */
bootloader_entry = (void (*)(void))(0x0);
}
/*
Invoke the bootloader
The bootloader will read pin P0.14 to detect if ISP is forced
Since P0.14 is configured as an output and set to 0, the
bootloader
will go in ISP mode.
*/
int main(void)
{
init();
bootloader_entry();
}
--- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> Yup There shore is !
>
> In the LPC2106 anyway. I dunno about the rest of them. But it
requrires a reset of the micro!
>
> Use the IAP instructions to erase the first block of flash memory.
>
> Drop the supply and bring it up again, and the chip detects the
lost of a valid program
> and automatically jumps to the ISP.
>
> I use this to update the firmware with P0.14 buried deep in a hunk
of expoxy, but watch it,
> Once the ISP is running anyone can steal your program !! I use a
very unlikely pass code in the operating firmware to do this.
>
> Owen Mooney
>
> Subject:
>
>
> Is there any way to launch the ISP software without having the BSL
> jumper on? (i.e. does it have an entry point that does not check
P0.14?)2004-11-19 by dave_albert
Thank you...this is exactly what I was looking for! In my application, the CPU is deeply embedded and is not accessible so it cannot be reset or power cycled. To prevent a situation where the device gets accidentally stuck in the ISP software, I would like to resume normal execution if the ISP software is not used for say 5 minutes. If I set the watchdog to ~5 minutes before launching the ISP, will the ISP code kick it (and thus never exit) or will it allow the watchdog to timeout and reset the node 5 minutes later? --- In lpc2000@yahoogroups.com, "Richard" <richas@y...> wrote:
>
> Here is some code that will invoke the bootloader which will read
> P0.14 (after you have set it low) and initiate ISP.
>
> Richard
>
> /* ISP Invocation code Richard Soennichsen - Philips
> Semiconductors */
> /*
> 10/11/2004
> */
>
> /* define the SFR addresses, this may already be handled in a header
> file */
>
> #define MEMMAP (*((volatile unsigned int *) 0xE01FC040))
> #define IODIR0 (*((volatile unsigned int *) 0xE0028008))
> #define IOCLR0 (*((volatile unsigned int *) 0xE002800C))
> #define PINSEL0 (*((volatile unsigned int *) 0xE002C000))
> #define VPBDIV (*((volatile unsigned int *) 0xE01FC100))
> #define PLLCON (*((volatile unsigned int *) 0xE01FC080))
> #define PLLFEED (*((volatile unsigned int *) 0xE01FC08C))
>
>
> void (*bootloader_entry)(void); /* Declare the entry function */
> unsigned long temp; /*Temporary
> variable */
>
> void init(void)
> {
> temp = PINSEL0; /* Connect RxD0 & TxD0 pins to GPIO */
> PINSEL0 = temp & 0xFFFFFFF3;
>
> /* Select P0.14 as an output and P0.1 as an input */
> /* P0.1 is sampled to determine baud rate */
> temp = IODIR0;
> temp = temp | 0x4000;
> temp = temp & 0xFFFFFFFD;
> IODIR0 = temp;
>
> IOCLR0 = 0x4000; /* Clear P0.14 */
>
> /*
> Disconnect PLL if you want to do ISP at crystal frequency.
> Otherwise you need to pass the PLL freq when bootloader goes in
> ISP mode.
> cclk = crystal when PLL is disconnected
> cclk = PLL freq when PLL is connected.
>
> Disconnecting the PLL is recommended.
>
> *pllcon = 0x0; / disconnect the PLL
> */
> *pllfeed = 0xAA;
> *pllfeed = 0x55;
> */
>
> /*
> Set the VPB divider to 1/4 if you application changes the VPBDIV
> value.
> The bootloader is hard-coded to use the reset value of VPBDIV
> register
> *vpbdiv = 0x0;
> */
>
> /* Map bootloader vectors */
> MEMMAP = 0x0;
>
> /* Point to bootloader entry point i.e. reset vector 0x0 */
>
> bootloader_entry = (void (*)(void))(0x0);
> }
> /*
> Invoke the bootloader
> The bootloader will read pin P0.14 to detect if ISP is forced
> Since P0.14 is configured as an output and set to 0, the
> bootloader
> will go in ISP mode.
> */
> int main(void)
> {
> init();
> bootloader_entry();
> }
>
>
>
>
>
>
>
> --- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> > Yup There shore is !
> >
> > In the LPC2106 anyway. I dunno about the rest of them. But it
> requrires a reset of the micro!
> >
> > Use the IAP instructions to erase the first block of flash memory.
> >
> > Drop the supply and bring it up again, and the chip detects the
> lost of a valid program
> > and automatically jumps to the ISP.
> >
> > I use this to update the firmware with P0.14 buried deep in a hunk
> of expoxy, but watch it,
> > Once the ISP is running anyone can steal your program !! I use a
> very unlikely pass code in the operating firmware to do this.
> >
> > Owen Mooney
> >
> > Subject:
> >
> >
> > Is there any way to launch the ISP software without having the BSL
> > jumper on? (i.e. does it have an entry point that does not check
> P0.14?)2004-11-19 by Leighton Rowe
> Thank you...this is exactly what I was looking for! > > In my application, the CPU is deeply embedded and is > not accessible so it cannot be reset or power cycled. > To prevent a situation where the device gets accidentally > stuck in the ISP software, I would like to resume normal > execution if the ISP software is not used for say 5 minutes. > If I set the watchdog to ~5 minutes before launching the ISP, > will the ISP code kick it (and thus never exit) or will it > allow the watchdog to timeout and reset the node 5 minutes > later? > No Power Cycle?...Ok then. In my opinion Dave, that would leave you with the "GO" Command (See ISP Commands in your UM) as the only ISP escape command. The code u jump to should then restore the system to your liking. I guess the challenge is preventing any alteration of the restoration code for every update. It's just an idea, but I guess it's worth trying. Thanks a mil Richard. I've been putting off my lpc firmware update research until I saw your code...a very clever & very simple piece of code. "ISP Invocation code" for Code Example of the Year!! :) Cheers, Leighton
2004-11-19 by dave_albert
Leighton, do you know if the ISP code kicks the watchdog? This should be a great help to me either way...I second your vote for best code example! --- In lpc2000@yahoogroups.com, "Leighton Rowe" <leightonsrowe@y...> wrote:
> > > Thank you...this is exactly what I was looking for! > > > > In my application, the CPU is deeply embedded and is > > not accessible so it cannot be reset or power cycled. > > To prevent a situation where the device gets accidentally > > stuck in the ISP software, I would like to resume normal > > execution if the ISP software is not used for say 5 minutes. > > If I set the watchdog to ~5 minutes before launching the ISP, > > will the ISP code kick it (and thus never exit) or will it > > allow the watchdog to timeout and reset the node 5 minutes > > later? > > > > No Power Cycle?...Ok then. > In my opinion Dave, that would leave you with the "GO" Command (See > ISP Commands in your UM) as the only ISP escape command. The code u > jump to should then restore the system to your liking. I guess the > challenge is preventing any alteration of the restoration code for > every update. It's just an idea, but I guess it's worth trying. > > Thanks a mil Richard. I've been putting off my lpc firmware update > research until I saw your code...a very clever & very simple piece > of code. "ISP Invocation code" for Code Example of the Year!! :) > > Cheers, > Leighton
2004-11-19 by Robert Adsett
At 06:27 AM 11/19/04 +0000, you wrote:
>Thank you...this is exactly what I was looking for!
You may be happy, I'm rather dismayed that this works. It means that P0.14
cannot be used in an application since it implies that if you get a for
instance watchdog reset while P0.14 happens to be low rather than
restarting the application you will enter ISP mode. Dangerous, Dangerous....
The other processors I've used that use this required that an external
reset be used before entering any special modes (such as ISP) in order to
prevent such behaviour. You did have to be careful about the reset state
but that's something you needed to be careful of anyway.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, III2004-11-19 by microbit
Hi Robert, That's exactly been my gripe ever since the LPC2104/5/6. I can't use P0.14 for generic I/O (for interpreter product), for the reasons you mention. Why could this not be on the NC pin on 44-QFP ??????? (die bonding reasons too I guess) -- Kris ----- Original Message ----- From: "Robert Adsett" <subscriptions@...> To: <lpc2000@yahoogroups.com> Sent: Saturday, November 20, 2004 3:37 AM Subject: Re: [lpc2000] Re: Any way to launch ISP ? > At 06:27 AM 11/19/04 +0000, you wrote: > >Thank you...this is exactly what I was looking for! > > You may be happy, I'm rather dismayed that this works. It means that P0.14 > cannot be used in an application since it implies that if you get a for > instance watchdog reset while P0.14 happens to be low rather than > restarting the application you will enter ISP mode. Dangerous, Dangerous.... > > The other processors I've used that use this required that an external > reset be used before entering any special modes (such as ISP) in order to > prevent such behaviour. You did have to be careful about the reset state > but that's something you needed to be careful of anyway. > > Robert > > " 'Freedom' has no meaning of itself. There are always restrictions, > be they legal, genetic, or physical. If you don't believe me, try to > chew a radio signal. " > > Kelvin Throop, III > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > > > > > -------------------------------------------------------------------------- ------
> Yahoo! Groups Links > > a.. To visit your group on the web, go to: > http://groups.yahoo.com/group/lpc2000/ > > b.. To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > >
2004-11-19 by microbit
That's not the problem. ----- Original Message ----- From: "Leighton Rowe" <leightonsrowe@...> To: <lpc2000@yahoogroups.com> Sent: Saturday, November 20, 2004 3:42 AM Subject: [lpc2000] Re: Any way to launch ISP ? > > > Leighton, do you know if the ISP code kicks the watchdog? This > should > > be a great help to me either way...I second your vote for best code > > example! > > Looking at the bootloader flowchart, it's hard to say what's really > in the ISP code (that we may never find out). Whether or not the ISP > has authority over the Watchdog? I doubt it, but don't take my word > on it. I haven't seen any instance of lpc's resetting itself (using > Watchdog or other means) during ISP mode. > > Leighton > > > > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > > > > > -------------------------------------------------------------------------- ------
> Yahoo! Groups Links > > a.. To visit your group on the web, go to: > http://groups.yahoo.com/group/lpc2000/ > > b.. To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > >
2004-11-19 by Leighton Rowe
> Leighton, do you know if the ISP code kicks the watchdog? This should > be a great help to me either way...I second your vote for best code > example! Looking at the bootloader flowchart, it's hard to say what's really in the ISP code (that we may never find out). Whether or not the ISP has authority over the Watchdog? I doubt it, but don't take my word on it. I haven't seen any instance of lpc's resetting itself (using Watchdog or other means) during ISP mode. Leighton
2004-11-19 by Lasse Madsen
I coudn't agree more. Also this is a problem Philips should have used the bootloader select pin as a separate pin that has nothing to do with on chip functions. It's a pain in the ass that P0.14 (DCD) on the full modem interface has to be taken special care of when connecting to a modem through multiplexers and such expensive garbage. I've used the LPC2106 a few times and flew back to AVR at an instant because of this and I'm now looking for other ARM controllers. /madsen
-----Original Message-----
From: Robert Adsett [mailto:subscriptions@...]
Sent: 19. november 2004 17:37
To: lpc2000@yahoogroups.com
Subject: Re: [lpc2000] Re: Any way to launch ISP ?
At 06:27 AM 11/19/04 +0000, you wrote:
>Thank you...this is exactly what I was looking for!
You may be happy, I'm rather dismayed that this works. It means that
P0.14
cannot be used in an application since it implies that if you get a for
instance watchdog reset while P0.14 happens to be low rather than
restarting the application you will enter ISP mode. Dangerous,
Dangerous....
The other processors I've used that use this required that an external
reset be used before entering any special modes (such as ISP) in order
to
prevent such behaviour. You did have to be careful about the reset
state
but that's something you needed to be careful of anyway.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, III
Yahoo! Groups Links2004-11-19 by Leighton Rowe
True...but remember the WatchDog Flag is always checked before P0.14 on the Boot Process Flowchart. --- In lpc2000@yahoogroups.com, "microbit" <microbit@c...> wrote: > That's not the problem. > > ----- Original Message ----- > From: "Leighton Rowe" <leightonsrowe@y...> > To: <lpc2000@yahoogroups.com> > Sent: Saturday, November 20, 2004 3:42 AM > Subject: [lpc2000] Re: Any way to launch ISP ? > > > > > > > Leighton, do you know if the ISP code kicks the watchdog? This > > should > > > be a great help to me either way...I second your vote for best code > > > example! > > > > Looking at the bootloader flowchart, it's hard to say what's really > > in the ISP code (that we may never find out). Whether or not the ISP > > has authority over the Watchdog? I doubt it, but don't take my word > > on it. I haven't seen any instance of lpc's resetting itself (using > > Watchdog or other means) during ISP mode. > > > > Leighton > > > > > > > > > > > > Yahoo! Groups Sponsor > > ADVERTISEMENT > > > > > > > > > > > > ----------------------------------------------------------------- --------- > ------ > > Yahoo! Groups Links > > > > a.. To visit your group on the web, go to: > > http://groups.yahoo.com/group/lpc2000/ > > > > b.. To unsubscribe from this group, send an email to: > > lpc2000-unsubscribe@yahoogroups.com > > > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > >
2004-11-19 by microbit
> True...but remember the WatchDog Flag is always checked before P0.14 > on the Boot Process Flowchart. Hi Leighton, Equally true, but the problem is the same on brownout or even possibly (more remote) on cold start. My app ignores P0.14, because I have a stamp-like RF module , and the user could be doing all sorts of things on this I/O pin. Making this safe inherently implies extra and irritating HW cost anyway. -- Kris > > > --- In lpc2000@yahoogroups.com, "microbit" <microbit@c...> wrote: > > That's not the problem. > > > > ----- Original Message ----- > > From: "Leighton Rowe" <leightonsrowe@y...> > > To: <lpc2000@yahoogroups.com> > > Sent: Saturday, November 20, 2004 3:42 AM > > Subject: [lpc2000] Re: Any way to launch ISP ? > > > > > > > > > > > Leighton, do you know if the ISP code kicks the watchdog? This > > > should > > > > be a great help to me either way...I second your vote for best > code > > > > example! > > > > > > Looking at the bootloader flowchart, it's hard to say what's > really > > > in the ISP code (that we may never find out). Whether or not the > ISP > > > has authority over the Watchdog? I doubt it, but don't take my > word > > > on it. I haven't seen any instance of lpc's resetting itself > (using > > > Watchdog or other means) during ISP mode. > > > > > > Leighton > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > ADVERTISEMENT > > > > > > > > > > > > > > > > > > ----------------------------------------------------------------- > --------- > > ------ > > > Yahoo! Groups Links > > > > > > a.. To visit your group on the web, go to: > > > http://groups.yahoo.com/group/lpc2000/ > > > > > > b.. To unsubscribe from this group, send an email to: > > > lpc2000-unsubscribe@yahoogroups.com > > > > > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms > of Service. > > > > > > > > > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > > > > > -------------------------------------------------------------------------- ------
> Yahoo! Groups Links > > a.. To visit your group on the web, go to: > http://groups.yahoo.com/group/lpc2000/ > > b.. To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > >
2004-11-19 by Bill Knight
Robert Won't the watchdog reset cause P0.14 to revert to an input? -Bill Knight http://www.theARMPatch.com On Fri, 19 Nov 2004 11:37:10 -0500, Robert Adsett wrote: At 06:27 AM 11/19/04 +0000, you wrote: >Thank you...this is exactly what I was looking for! You may be happy, I'm rather dismayed that this works. It means that P0.14 cannot be used in an application since it implies that if you get a for instance watchdog reset while P0.14 happens to be low rather than restarting the application you will enter ISP mode. Dangerous, Dangerous.... The other processors I've used that use this required that an external reset be used before entering any special modes (such as ISP) in order to prevent such behaviour. You did have to be careful about the reset state but that's something you needed to be careful of anyway. Robert
2004-11-19 by Leighton Rowe
> Equally true, but the problem is the same on brownout or even possibly > (more remote) on cold start. Point taken. Though I understand how the Watchdog generally works, I've heard about strange problems (like the ones u mentioned) that can happen if used. So, I won't fully trust Watchdogs yet. > My app ignores P0.14, because I have a stamp-like RF module , and the user > could be doing all sorts of things on this I/O pin. > Making this safe inherently implies extra and irritating HW cost anyway. That's the give-and-take nature of the design game. Unfortunately, I'm running an LED over P0.14. So, there's no way for me to get around that unless I include a jumper & do power cycles. Right now I'm weighing out IAP/ISP pros & cons. My biggest challenge since Summer was to update firmware using IAP calls. I believe this would give the application code far better code control & security. But right now it just looks quite complex to implement. The thing I like about the previously posted code is that both P0.14 & reset issues were nullified, making ISP look surprisingly much easier to do. But knowing ISP communication is ASCII based, code security can be compromised, as Owen previously mentioned. Leighton
2004-11-19 by Robert Adsett
At 12:03 PM 11/19/04 -0600, you wrote:
> Won't the watchdog reset cause P0.14 to revert to an input?
Good point Bill, I had forgotten that and that the WD state was
checked. That makes the hole much smaller. I still don't like the idea
that a jump to 0 can invoke the ISP (it does eliminate the possibility of
using that as a soft reset to restart the system) but barring executing a
null pointer the rest of the avenues are covered. So using P0.14 as an
output should be relatively safe. Like wise as an input if you can
guarantee the reset state. It would be safer still though if the boot
actually cared about the state of the reset pin.
As far as having pins mean different things on startup, I'm used to
that. The ST10 had (I think) 16 pins to configure the processor that were
read on input on a reset. They were ignored if the processor restarted for
ANY other reason. The Intel 196 had similar (but fewer) pins that could
place the chip into test modes if not in the right state on reset.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, III2004-11-23 by Sébastien MARION (UMM)
Hi,
I testing this code with an half success :
My program is in external flash (I use the LPC2210) and for writing in this flash I load by ISP command a Simple Program in RAM.
I Include in my main program (who is in flash) an RS command who launch this code.
When I Load My simple Program in ram by manually enter in ISP mode and then launch my main program ( my code is :
static void GoMain(void) {
REG(SYSCON_MEMMAP) = 0x3;
Reset();
}
static void Reset(void) {
void (*bootloader_entry)(void);
bootloader_entry = (void (*)(void))(0x0);
bootloader_entry();
}
) I can send my RS command to launch ISP with success.
BUT when I start my main program normally (without passing by ISP and ram code) and launch the same RS command who call the same function It doesn't work !
I think ISP change a default value somewhere that I don't touch in my main program, and who is not set in this code, but I don't find it.
If any body as an idea, I be very happy.
Sebastien
ps : sorry for my bad english. ----- Original Message -----
From: Richard
To: lpc2000@yahoogroups.com
Sent: Friday, November 19, 2004 12:39 AM
Subject: [lpc2000] Re: Any way to launch ISP ?
Here is some code that will invoke the bootloader which will read
P0.14 (after you have set it low) and initiate ISP.
Richard
/* ISP Invocation code - Richard Soennichsen - Philips
Semiconductors */
/*
10/11/2004
*/
/* define the SFR addresses, this may already be handled in a header
file */
#define MEMMAP (*((volatile unsigned int *) 0xE01FC040))
#define IODIR0 (*((volatile unsigned int *) 0xE0028008))
#define IOCLR0 (*((volatile unsigned int *) 0xE002800C))
#define PINSEL0 (*((volatile unsigned int *) 0xE002C000))
#define VPBDIV (*((volatile unsigned int *) 0xE01FC100))
#define PLLCON (*((volatile unsigned int *) 0xE01FC080))
#define PLLFEED (*((volatile unsigned int *) 0xE01FC08C))
void (*bootloader_entry)(void); /* Declare the entry function */
unsigned long temp; /*Temporary
variable */
void init(void)
{
temp = PINSEL0; /* Connect RxD0 & TxD0 pins to GPIO */
PINSEL0 = temp & 0xFFFFFFF3;
/* Select P0.14 as an output and P0.1 as an input */
/* P0.1 is sampled to determine baud rate */
temp = IODIR0;
temp = temp | 0x4000;
temp = temp & 0xFFFFFFFD;
IODIR0 = temp;
IOCLR0 = 0x4000; /* Clear P0.14 */
/*
Disconnect PLL if you want to do ISP at crystal frequency.
Otherwise you need to pass the PLL freq when bootloader goes in
ISP mode.
cclk = crystal when PLL is disconnected
cclk = PLL freq when PLL is connected.
Disconnecting the PLL is recommended.
*pllcon = 0x0; / disconnect the PLL
*/
*pllfeed = 0xAA;
*pllfeed = 0x55;
*/
/*
Set the VPB divider to 1/4 if you application changes the VPBDIV
value.
The bootloader is hard-coded to use the reset value of VPBDIV
register
*vpbdiv = 0x0;
*/
/* Map bootloader vectors */
MEMMAP = 0x0;
/* Point to bootloader entry point i.e. reset vector 0x0 */
bootloader_entry = (void (*)(void))(0x0);
}
/*
Invoke the bootloader
The bootloader will read pin P0.14 to detect if ISP is forced
Since P0.14 is configured as an output and set to 0, the
bootloader
will go in ISP mode.
*/
int main(void)
{
init();
bootloader_entry();
}
--- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> Yup There shore is !
>
> In the LPC2106 anyway. I dunno about the rest of them. But it
requrires a reset of the micro!
>
> Use the IAP instructions to erase the first block of flash memory.
>
> Drop the supply and bring it up again, and the chip detects the
lost of a valid program
> and automatically jumps to the ISP.
>
> I use this to update the firmware with P0.14 buried deep in a hunk
of expoxy, but watch it,
> Once the ISP is running anyone can steal your program !! I use a
very unlikely pass code in the operating firmware to do this.
>
> Owen Mooney
>
> Subject:
>
>
> Is there any way to launch the ISP software without having the BSL
> jumper on? (i.e. does it have an entry point that does not check
P0.14?)
Yahoo! Groups Sponsor
ADVERTISEMENT
------------------------------------------------------------------------------
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc2000/
b.. To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]2004-12-25 by dave_albert
I restored most of the registers I touched (uart, timers, pll, mam,
etc.) to their reset condition and it worked perfectly.
"Synchronized response"...I keep sending '?' and it keeps responding
--- In lpc2000@...m, Sébastien MARION (UMM) <s.marion@u...>
wrote:
> Hi,
>
> I testing this code with an half success :
>
> My program is in external flash (I use the LPC2210) and for
writing in this flash I load by ISP command a Simple Program in RAM.
> I Include in my main program (who is in flash) an RS command who
launch this code.
> When I Load My simple Program in ram by manually enter in ISP mode
and then launch my main program ( my code is :
> static void GoMain(void) {
> REG(SYSCON_MEMMAP) = 0x3;
> Reset();
> }
>
> static void Reset(void) {
> void (*bootloader_entry)(void);
> bootloader_entry = (void (*)(void))(0x0);
> bootloader_entry();
> }
> ) I can send my RS command to launch ISP with success.
>
> BUT when I start my main program normally (without passing by ISP
and ram code) and launch the same RS command who call the same
function It doesn't work !
>
> I think ISP change a default value somewhere that I don't touch in
my main program, and who is not set in this code, but I don't find it.
>
> If any body as an idea, I be very happy.
>
> Sebastien
>
> ps : sorry for my bad english.
>
>
> ----- Original Message -----
> From: Richard
> To: lpc2000@yahoogroups.com
> Sent: Friday, November 19, 2004 12:39 AM
> Subject: [lpc2000] Re: Any way to launch ISP ?
>
>
>
> Here is some code that will invoke the bootloader which will read
> P0.14 (after you have set it low) and initiate ISP.
>
> Richard
>
> /* ISP Invocation code - Richard Soennichsen - Philips
> Semiconductors */
> /*
> 10/11/2004
> */
>
> /* define the SFR addresses, this may already be handled in a header
> file */
>
> #define MEMMAP (*((volatile unsigned int *) 0xE01FC040))
> #define IODIR0 (*((volatile unsigned int *) 0xE0028008))
> #define IOCLR0 (*((volatile unsigned int *) 0xE002800C))
> #define PINSEL0 (*((volatile unsigned int *) 0xE002C000))
> #define VPBDIV (*((volatile unsigned int *) 0xE01FC100))
> #define PLLCON (*((volatile unsigned int *) 0xE01FC080))
> #define PLLFEED (*((volatile unsigned int *) 0xE01FC08C))
>
>
> void (*bootloader_entry)(void); /* Declare the entry function */
> unsigned long temp; /*Temporary
> variable */
>
> void init(void)
> {
> temp = PINSEL0; /* Connect RxD0 & TxD0 pins to GPIO */
> PINSEL0 = temp & 0xFFFFFFF3;
>
> /* Select P0.14 as an output and P0.1 as an input */
> /* P0.1 is sampled to determine baud rate */
> temp = IODIR0;
> temp = temp | 0x4000;
> temp = temp & 0xFFFFFFFD;
> IODIR0 = temp;
>
> IOCLR0 = 0x4000; /* Clear P0.14 */
>
> /*
> Disconnect PLL if you want to do ISP at crystal frequency.
> Otherwise you need to pass the PLL freq when bootloader goes in
> ISP mode.
> cclk = crystal when PLL is disconnected
> cclk = PLL freq when PLL is connected.
>
> Disconnecting the PLL is recommended.
>
> *pllcon = 0x0; / disconnect the PLL
> */
> *pllfeed = 0xAA;
> *pllfeed = 0x55;
> */
>
> /*
> Set the VPB divider to 1/4 if you application changes the VPBDIV
> value.
> The bootloader is hard-coded to use the reset value of VPBDIV
> register
> *vpbdiv = 0x0;
> */
>
> /* Map bootloader vectors */
> MEMMAP = 0x0;
>
> /* Point to bootloader entry point i.e. reset vector 0x0 */
>
> bootloader_entry = (void (*)(void))(0x0);
> }
> /*
> Invoke the bootloader
> The bootloader will read pin P0.14 to detect if ISP is forced
> Since P0.14 is configured as an output and set to 0, the
> bootloader
> will go in ISP mode.
> */
> int main(void)
> {
> init();
> bootloader_entry();
> }
>
>
>
>
>
>
>
> --- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> > Yup There shore is !
> >
> > In the LPC2106 anyway. I dunno about the rest of them. But it
> requrires a reset of the micro!
> >
> > Use the IAP instructions to erase the first block of flash memory.
> >
> > Drop the supply and bring it up again, and the chip detects the
> lost of a valid program
> > and automatically jumps to the ISP.
> >
> > I use this to update the firmware with P0.14 buried deep in a hunk
> of expoxy, but watch it,
> > Once the ISP is running anyone can steal your program !! I use a
> very unlikely pass code in the operating firmware to do this.
> >
> > Owen Mooney
> >
> > Subject:
> >
> >
> > Is there any way to launch the ISP software without having the BSL
> > jumper on? (i.e. does it have an entry point that does not check
> P0.14?)
>
>
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
>
>
------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/lpc2000/
>
> b.. To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service. > > > > [Non-text portions of this message have been removed]