4 years, 3 months ago.  This question has been closed. Reason: Unclear question

void exit(int return_code) code enters in to while loop and never returns

Hello,

I Am facing this issue from yesterday. I have no idea what would be mistake. I am using Stm32l073 controller to flash my code and unfortunately I am unable to transmit data from pc to my device but able to receive. I did then debug the code and found that it enters in to void exit function in retarget.cpp file and stuck at while loop. I have no idea what would cause this kind of problem and how to solve this. Could anyone had this issue. Kindly provide me how to solve this issue/media/uploads/sandeepmalladi/starnge_behaviour_.jpg .Thanks

retarget.cpp

namespace std {
extern "C" void exit(int return_code) {
#endif

#if DEVICE_STDIO_MESSAGES
#if MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT
    fflush(stdout);
    fflush(stderr);
#endif
#endif

#if DEVICE_SEMIHOST
    if (mbed_interface_connected()) {
        semihost_exit();
    }
#endif
    if (return_code) {
        mbed_die();
    }

    while (1);
}