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.
8 years, 9 months ago.
Uart going to mbed_die after deepsleep
Hi All, i'm experiencing a problem on my custom L152RE board. My software handles 3 interrupt driven serial interfaces with callbacks. I rely on WakeUp library to wake up my board from deepsleep time to time. In my main cycle, i have something like this:
my cycle
WakeUp::set_ms(SLEEP_TIME); DisableSerial(); deepsleep(); ReEnableSerial();
where DisableSerial() is where i reconfigure serial pins ad outputs
=
void DisableSerial(){
//Reconfigure Serial pins as outputs
DigitalOut pb10(PB_10);
DigitalOut pb11(PB_11);
DigitalOut pa9(PA_9);
DigitalOut pa10(PA_10);
DigitalOut pa2(SERIAL_TX);
DigitalOut pa3(SERIAL_RX);
//pull down to save power before sleeping
pb10=0;
pb11=0;
pa9=0;
pa10=0;
pa2=0;
pa3=0;
and ReEnableSerial() is where i reinitialize the serial ports,assigning callback, bauds, etc.
=
void ReEnableSerial(){
Serial Bluetooth(SERIAL_TX,SERIAL_RX);
Serial Modem(PB_10,PB_11);
Serial Gps(PA_9,PA_10);
Modem.attach(&ModemRxCallback,Serial::RxIrq);
Modem.baud(115200);
Gps.attach(&GpsRxCallback);
Gps.baud(9600);
Bluetooth.attach(&BtRxCallback);
Bluetooth.baud(9600);
}
After i call ReEnableSerial(), at first SerialPortName.printf("mymessage"), program goes to mbed_die. And i can't understand why and what to do to avoid this.