XdkExtensionPort UART error
Antwort
25.09.19 05:57

Hello,

I want to send and receive data from external device via extension port UART.

I'm using XdkExtensionPort example in workbench 340.

I added some test codes in the while loop of AppConrollerFire.

But I'm getting error message like below.

 INFO | XDK DEVICE 3: Error in Essentials package.
 INFO | XDK DEVICE 3:     Package ID: 35    Module ID: 3    Severity code: 2    Error code: 66
 INFO | XDK DEVICE 3: Error in Essentials package.
 INFO | XDK DEVICE 3:     Package ID: 35    Module ID: 3    Severity code: 2    Error code: 66
 INFO | XDK DEVICE 3: Error in Essentials package.
 INFO | XDK DEVICE 3:     Package ID: 35    Module ID: 3    Severity code: 2    Error code: 66

What is the problem? Below is the code AppControllerFire I'm writing.

static void AppControllerFire(void* pvParameters)
{
    BCDS_UNUSED(pvParameters);

    Retcode_T retcode = RETCODE_OK;

    while (1)
    {
#if EXTENSION_PORT_UART_FEATURE
        if (RETCODE_OK == retcode)
        {
            uint8_t buffer[] = "Hello";
            uint32_t bufferLength = sizeof(buffer)/sizeof(uint8_t);
            retcode = ExtensionUartExample_Write(buffer, bufferLength);
            if (RETCODE_OK == retcode)
            {
                printf("Example_Write is successful___");
            }
            else
            {
                printf("Example_Write is failed___");
            }
        }

#endif

        if (RETCODE_OK != retcode)
        {
            Retcode_RaiseError(retcode);
        }

        //vTaskSuspend(NULL); /* Passing the parameter as NULL will suspend the calling task */
    }
}

 

0 (0 Stimmen)
RE: XdkExtensionPort UART error
Antwort
25.09.19 08:17 als Antwort auf Daewon Kim.

Hello,

Error code is from Essentials package: RETCODE_HAL_UART_DRIVER_TX_NOT_READY.

Please check whether UART is properly initialized and also consider adding a FreeRTOS delay between every UART transmission.

0 (0 Stimmen)
RE: XdkExtensionPort UART error
Antwort
08.10.19 01:35 als Antwort auf Padmapriya G.

Hello,

Thank you very much for your help.

I checked initializing again and successfully connected.

Sending command is successful and can get response from external device (Keyence RS-232C communication unit DL-RS1A).

But there are missing values in Data area in the response.

10 byte data should be received like -123.45678 in (4) Data area.

But only -123 is received like -123??????

 

I used variables as below.

int8_t bufferR[21];

uint32_t dataLength = 21;

uint32_t actualLength = 0;

retcodeR = ExtensionUartExample_Read(bufferR, dataLength, &actualLength);

 

Is there any check point to solve this situation?

0 (0 Stimmen)