AnsweredAssumed Answered

IMX6SX MCC, M4 recives garbage message

Question asked by niranjanbc on Mar 20, 2017
Latest reply on Mar 21, 2017 by niranjanbc

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;
}

Outcomes