Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 months ago.
11u24 Program Stuck in Memory
I used the following code
Break Your MBED
#include "mbed.h" InterruptIn wakeup(p14); DigitalOut led(LED1); // Pulled from mbed SDK sources but removed mbed_interface_disconnect() call // since that would cause halt when it tried to disable the interface chip // which isn't powered up when I am powering the device from VB. void deepsleep(void) { // PCON[PD] set to deepsleep LPC_PMU->PCON = 0x1; // SRC[SLEEPDEEP] set to 1 = deep sleep SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // Power up everything after powerdown LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800; // wait for interrupt __WFI(); } static void dummyHandler(void) { return; } int main () { wakeup.rise(&dummyHandler); // Setup rising edge interrupt led = 1; while (1) { deepsleep(); // Deep sleep until external interrupt led = !led; } }
I added the & to pass by reference to the dummy handler so that I could actually throw a little code in there. Guess what, now when I load new programs to my mbed they will stay on the drive, but the processor will only run this code. I have disconnected usb, pressed power button, etc. Any ideas?
1 Answer
10 years, 9 months ago.
I am answering my own question. I did the reset described here. http://mbed.org/cookbook/Unbricking I had to do it when the processor was not asleep.