6 years, 3 months ago.

System WorkBench UART interrupt Crash

/media/uploads/epsragh/stack_trace_crash.png Hi I am working on STM32L475 IoT Board My code is

UART1 CODE

//GPS and GPRS
#define  AT_SIM_VERSION   "ATI"
#define AT_BOARD_PWR_ON   "AT+CGPSPWR=1"
#define AT_CGPSINF_O      "AT+CGPSINF=0"
#define AT_CGPSINF_32     "AT+CGPSINF=32"
#define AT_3D_FIX_CHECK   "AT+CGPSSTATUS?"
#define AT_GET_CONT_COORD "AT+CGPSOUT=32"
#define AT_GET_ONCE_COORD "AT+CGPSOUT=1"

#define AT_STOP_COORD     "AT+CGPSOUT=0"
#include "mbed.h"

Serial uart(A4,A5,115200);
Serial pc(USBTX,USBRX,115200);

void gps_pos();
void rx_fun()
{
        if(uart.readable())
        {
            pc.putc(uart.getc());
        }
}
int main(int argc, char* argv[])
{
   uart.attach(&rx_fun, Serial::RxIrq);
    gps_pos();
}
void gps_pos(){

   uart.printf("%s\n\r",AT_SIM_VERSION);
    wait(1);
    //AT+CGPSPWR=1
   uart.printf("%s\n\r",AT_BOARD_PWR_ON);
    wait(28);
    uart.printf("%s\n\r",AT_CGPSINF_32);
    wait(2);
    uart.printf("%s\n\r",AT_3D_FIX_CHECK);
}
/*
CRASH LOG
++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x20001508, 
Location: 0x800b01b
Error Value: 0x20001508
Current Thread: Id: 0x20002f2c Entry: 0x800bf55 StackSize: 0x100 StackMem: 0x20003078 SP: 0x10007f20 
-- MbedOS Error Info --
*/

My Above code compiled in System WorkBench Successfully, but crashes in run_fun() function. But same thing works fine without crash if i use online Mbed Compiler, can some one help please.

1 Answer

6 years, 3 months ago.

Hi,

I saw a very similar thing today : ( But, it got solved by not using debug.json, and instead using release.json. See here: https://raw.githubusercontent.com/ARMmbed/mbed-os/master/tools/profiles/release.json

Use it like this:

mbed compile -t GCC_ARM -m K64F --profile release.json