This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UART5 problem

Dear all

I'm found a problem on UART5.

At the startup I use   UARTCharPut() to send a charactere and the routine work correctly.

Into the loop I used UARTprintf() but the firmware stall.

Follow the code:

 while(1)
    {
       
              pui8MsgData[0]= ui32MsgData;            // Messafe data to trasmit on CAN0 controller
            
        // Send the CAN message using object number 1 (not the same thing as
        // CAN ID, which is also 1 in this example).  This function will cause
        // the message to be transmitted right away.
        CANMessageSet(CAN0_BASE, 1, &sCANMessageTX, MSG_OBJ_TYPE_TX);  

        
              while((CANStatusGet(CAN1_BASE, CAN_STS_NEWDAT)& 0x1)== 0x1)
                {
                    CANMessageGet(CAN1_BASE, 1, &sCANMessageRX, 0);
                }
            
        // Check the error flag to see if errors occurred
        if(g_bErrFlag)
        {
          UARTprintf("Message Tx: NAK");    // code stall here
                    GPIOPinWrite(GPIO_PORTQ_BASE, GPIO_PIN_7, 0x00); 
                   g_bErrFlag= 0;
        }
        else
        {
            
          UARTprintf("Message Tx: OK");     // cade stall here
          GPIOPinWrite(GPIO_PORTQ_BASE, GPIO_PIN_7, 0x80);        // TX OK LED verde acceso        
        }

        // Increment the value in the message data.
        ui32MsgData++;
                
                SimpleDelay();
    }

if I remuve the two UARTprintf() statement code run correctly.

Have you same ideas?

Many Thanks

M

  • Hello Messori,

    The UARTprintf comes from the uartstdio.c file in utils. The selection options for which UART will use the printf functions is limited to UART0 to UART2. The same needs to be modified for UART5 as well so that the correct peripheral is referred when sending the character stream

    Regards

    Amit