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]Message
Re: [lpc2000] Re: Any way to launch ISP ?
2004-11-23 by Sébastien MARION (UMM)
Attachments
- No local attachments were found for this message.