IMX6SX MCC, M4 recives garbage message

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6SX MCC, M4 recives garbage message

978 Views
niranjanbc
Contributor IV

i have the thread in linux(running on A9 Core), which call MCC TTY driver APIs for initialization, and to send messages to M4 core running MQX.  all i see either zeroes or garbage message on M4. does anyone know what is the issue here.

below my code written for initialization and sending message to M4 from A9.

if just open the port TTYMCC with below code and once the port is opened by thread, then send the message from console like --> echo testmessage > /dev/ttyMCC. this works

i can see message this message "testmessage" at M4.


 /****************************TTYMCC initialization ********************************/

    int fd;

    fd = open(dev, O_RDWR |  O_NOCTTY);
    if (fd < 0) {
        perror("Can't open serial port");
        return -1;
    }

    tcflush(fd, TCIOFLUSH);

    if (tcgetattr(fd, ti) < 0) {
        perror("Can't get port settings");
        return -1;
    }

    cfmakeraw(ti);
    printf("Serial port %s opened\n", dev);

   

    if(fd >=0)
    {
        set_speed(fd, &ti, atoi("115200"));
    }

/***************************sending messages to M4 Core**************************/

bool BufferTransferToM4(char *buffer, ULONG bufferSize, int fdAIO)
{
    bool success = true;
    int ret=0;


     if(fdAIO >=0)
    {
        ret = write(fdAIO, buffer, bufferSize);
        if(ret < 0)
        {
            success = false;
            LOG_TO_CONSOLE("A9 Main task send error\n");
        }
    }
    else
    {
        success = false;
    }

    return success;
}

Labels (4)
0 Kudos
4 Replies

771 Views
igorpadykov
NXP Employee
NXP Employee

Hi niranjanbc

please try "uart_from_osc" kernel boot parameter described

in Table 10 attached Release Notes.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

771 Views
niranjanbc
Contributor IV

Hi igorpadykov

i tried below environment setting

setenv mmcargs "${mmcargs} uart_from_osc" 

still got same issue.

if i write to ttyMCC from console, M4 reads the message fine.

only problem when use function write(), i get garbage.

ttyMCC is driver for Multicore communication (imx_mcc_tty.c)

thanks

Niranjan

0 Kudos

771 Views
niranjanbc
Contributor IV

i think i found the problem, issue was in the sample driver, strlcpy() function.

0 Kudos

771 Views
niranjanbc
Contributor IV
0 Kudos