Beispiel #1
0
void __mriDebugException(void)
{
    int wasWaitingForGdbToConnect = IsWaitingForGdbToConnect();
    int justSingleStepped = Platform_IsSingleStepping();
    
    if (Platform_CommCausedInterrupt() && !Platform_CommHasReceiveData())
    {
        Platform_CommClearInterrupt();
        return;
    }

    Platform_EnteringDebuggerHook();
    blockIfGdbHasNotConnected();
    Platform_EnteringDebugger();
    determineSignalValue();
    
    if (isDebugTrap() && 
        Semihost_IsDebuggeeMakingSemihostCall() && 
        Semihost_HandleSemihostRequest() &&
        !justSingleStepped )
    {
        prepareForDebuggerExit();
        return;
    }
    
    if (!wasWaitingForGdbToConnect)
    {
        Platform_DisplayFaultCauseToGdbConsole();
        Send_T_StopResponse();
    }
    
    GdbCommandHandlingLoop();

    prepareForDebuggerExit();
}
Beispiel #2
0
static void waitForUartToReceiveData(void)
{
    while (!Platform_CommHasReceiveData())
    {
        yieldUartBusToDma();
    }
}
Beispiel #3
0
static int hasHostSentDataInLessThan10Milliseconds(void)
{
    uint32_t originalSysTickControlValue = getCurrentSysTickControlValue();
    uint32_t originalSysTickReloadValue = getCurrentSysTickReloadValue();
    start10MillisecondSysTick();

    while (isNoReceivedCharAndNoTimeout())
    {
    }

    setSysTickReloadValue(originalSysTickReloadValue);
    setSysTickControlValue(originalSysTickControlValue);
    
    return Platform_CommHasReceiveData();
}
Beispiel #4
0
static int isNoReceivedCharAndNoTimeout(void)
{
    return !Platform_CommHasReceiveData() && !has10MillisecondSysTickExpired();
}
Beispiel #5
0
static void waitForUartToReceiveData(void)
{
    while (!Platform_CommHasReceiveData())
    {
    }
}
Beispiel #6
0
static void waitForReceiveData()
{
    while (!Platform_CommHasReceiveData())
    {
    }
}