Hi.
I'm starting to use the LPC824 on a custom board, after I used a development board for some time.
It happens however that I could program the microcontroller only once! The first try it programmed without any problem. After that it doesn't seem to be entering ISP mode anymore.
It seems like a standard CRP behaviour (I can no longer access the chip neither by ISP nor by SWDIO with an LPC Link2 I have). But I didn't change the "startup_LPC82x.s" and I already checked that the CRP is not activated:
"
IF :LNOT::DEF:NO_CRP
AREA |.ARM.__at_0x02FC|, CODE, READONLY
DCD 0xFFFFFFFF
ENDIF
AREA |.text|, CODE, READONLY
"
Can there be other reason why the chip is not entering ISP mode?
I'm using deep-power-down mode, but I couldn't find anywhere in the documentation something that relates deep-power-down with a problem in ISP.
Here is my main.c, if there is someone who can help me:
"
while(1) {
// System initialization
SYS_Init();
UART_Init();
// Debug UART initialization
uart_dbg = UART_GetUart(UART_DEBUG);
UART_ConfigureUART(uart_dbg, B115200, FALSE);
UART_EchoOn(uart_dbg);
// Read the device UID and store it for future use
SYS_ReadUID(UID);
// Identifies itself on the debug UART
sprintf(str, "\r\n\r\nI'm alive!\r\n");
UART_SendText(uart_dbg, str);
sprintf(str, "Dev UID:\"%08X:%08X:%08X:%08X\"\r\n", UID[0], UID[1], UID[2], UID[3]);
UART_SendText(uart_dbg, str);
sprintf(str, "Reset Type: %02X\r\n", SYS_GetResetStatus());
UART_SendText(uart_dbg, str);
// Clears the reset status register if wake-up was not from POR (Power-On Reset)
if(SYS_GetResetStatus() != 0) {
SYS_ClearResetStatus();
}
sprintf(str, "Time since first boot: %lu\r\n", SYS_GetTimeSinceStart());
UART_SendText(uart_dbg, str);
// Configures the watchdog and BOD blocks to be powered-down during deep-power-down mode
LPC_SYSCON->PDSLEEPCFG = (1 << 3) | (1 << 6);
// Configures the wake-up configuration register to have all blocks powered-up upon wake-up
LPC_SYSCON->PDAWAKECFG = 0;
// Enables the self-wake-up timer interrupt wake-up
LPC_SYSCON->STARTERP1 = (1 << 15);
//Waits while the Debug UART is still transmitting
while(UART_CheckTransmitIdle(uart_dbg) == 0);
// Configures self wake-up timer to wake-up SLEEP_TIME seconds before next cycle
SYS_SetSelfWakeTimer(SLEEP_TIME);
// Enters deep-power-down
SYS_DeepPowerDown();
}
}
Thank you,
Pedro.
Hi Kerry.
I'm already using Flash Magic and I had already tried the ISP sequence by using PIO0_12 and PIO0_1 and PIO0_4 as rx and tx. But it wouldn't enter ISP anyway...
But after several attempts yesterday, I managed to enter ISP mode! I did it by completely turning off the circuit for some time and then powering it on with both the ISP and reset buttons already pressed. If I tried to do it (1-press ISP, 2-press reset, 3-release reset, 4-release ISP) without turning off power, it seemed that the chip would react to reset but not the ISP... I don't know why...
So I decided to modify my program to perform all the tests without entering deep power down (I added a simple delay loop to simulate the deep power down cycle) and I will add the deep power down cycle only at the end of this stage.
After this modification I'm able to reprogram the chip without any problem!
Thank you for your help,
Pedro.
Hello Pedro,
Thank you very much for your updated information.
If you are not mind, you can send me your problem test project or the .hex file, I will test it on my LPCXpresso824 board.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello pedro Lousa,
When you enter deep sleep mode, it is normally can't use SWD to connect it.
You can enter ISP mode like this:
PIO0_12 is low, then press the reset button.
Now the chip will enter ISP mode.
Use the flash magic to connect the chip by U0_RXD=pio0_1 and U0_TXD=pio0_4.
Please try it at first.
If you still have problem, you can send me your test project, I will try it on my side.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------