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.

IPC操作MTOCIPCADDR与CTOMIPCADDR的问题

Other Parts Discussed in Thread: CONTROLSUITE

M3读写C28 MSGRAM时,MTOCIPCADDR中的数是对应M3这边的地址还是C28那边对应的地址?

还有一个问题,如果存在一个M3与C28都会读写的变量,我是否可以只放在MTOCMSGRAM 里或者只放CTOMMSGRAM里?

  • MTOCIPCADDR是M3的地址,用于需要C28x进行读写的地址,M3可读可写,C28x只能读。

    第二个问题,肯定是可以的,以MtoC28x为例,M3指定MTOCIPCADDR的地址,然后MTOCIPCCOM写入读写命令,由MTOCIPCDATAW完成写数据,由MTOCIPCDATAR完成读数据。

  • 写入时:

    M3向C28X发送 命令,28x要写的地址(28x的地址),数据长度,要写的数据,然后IPC置位让28X中断。

    28X中断判断命令,针对地址进行写入。

    读取时:

    M3要读C28X侧的内容,发送,命令,要读的地址(28x侧的地址),FLAG,数据大小,以及读取后存放的位置(M3侧的地址)。(MTCRAM)

    28x收到命令后,读取,向M3发送命令,要写入的地址[上面的读取后存放的位置(M3侧的地址)],FLAG,数据大小,以及数据。(CTOM RAM)

    第二个问题没能理解。MTOCMSGRAM和CTOMMSGRAM区别是M3与C28都可以读他们,但不是都可以写。

  • Forrest:

    第一个问题你回答的跟鸵鸟蝈蝈的不一样,按你的说法MTOCIPCADDR中要写入数是C28侧的地址?

    第二个问题是CTOMMSGRAM中的一个地址,C28既可以直接读写,M3又可以通过IPC的一系列命令进行读写操作,是不是这样?

  • 晕,一不小心说法打架了。不知道是不是我对您的问题理解错了,请看下面的图。

    第二个问题,CTOMMSGRAM中的一个地址,C28既可以直接读写,M3也可以直接读,但可以通过IPC的一系列命令进行写操作。

  • 您好!

    不好意思,第一个问题应该是我理解的有误了。刚刚重新查看了一下用户指南。上面有这么一段描述整个过程:

    1. When M3 requires the data from C28x memory, M3 should write a value of 0x0000007 (arbitrarily represents "16-bit data read" command) in the MTOCIPCCOM register and the address where it wants C28x to read data in the MTOCIPCADDR register.

    2. After writing to these IPC message registers, M3 should raise an IPC request using either an MTOCIPC flag or interrupt.

    3. When C28x gets this IPC request from M3, C28x software should be designed to read the MTOCIPCCOM register and understand that the command value of 0x00000007 means 16-bit data command.

    4. Upon understanding the command, C28x software should read the MTOCIPCADDR register to get the address that M3 wrote.

    5. Then C28x software can read the data from that address and write the data that it obtained by reading that memory location in MTOCIPCDATAR for M3 to read.

    那么依据数据手册的话,应该是C28x的memory。

     

  • 您好!

    不好意思,第一个问题应该是我理解的有误了。刚刚重新查看了一下用户指南。上面有这么一段描述整个过程:

    1. When M3 requires the data from C28x memory, M3 should write a value of 0x0000007 (arbitrarily represents "16-bit data read" command) in the MTOCIPCCOM register and the address where it wants C28x to read data in the MTOCIPCADDR register.

    2. After writing to these IPC message registers, M3 should raise an IPC request using either an MTOCIPC flag or interrupt.

    3. When C28x gets this IPC request from M3, C28x software should be designed to read the MTOCIPCCOM register and understand that the command value of 0x00000007 means 16-bit data command.

    4. Upon understanding the command, C28x software should read the MTOCIPCADDR register to get the address that M3 wrote.

    5. Then C28x software can read the data from that address and write the data that it obtained by reading that memory location in MTOCIPCDATAR for M3 to read.

    那么依据数据手册的话,应该是C28x的memory。

     

  • Forrest :

    1,你发的图看不到呀。

    2,“第二个问题,CTOMMSGRAM中的一个地址,C28既可以直接读写,M3也可以直接读,但可以通过IPC的一系列命令进行写操作。”

    按你这样说的话,MTOCIPCDATAR这个寄存器就没用了啊。当M3读C28 CTOMMSGRAM区的时候,MTOCIPCDATAR这个寄存器存放的就是所要读的数。

    另外还有资料Technical Reference Manual第157页中一段请你和 鸵鸟蝈蝈看看:

    Let us consider an example for the usage of these registers. The user's application might have a scenario

    where M3 requires knowing the data in one of the memories mapped to C28x to which M3 does not have

    read access. For this scenario, software can be designed such that:

  • mtoc_ipcdrivers_lite_c28.c

    mtoc_ipcdrivers_lite_m3.c

    controlsuite中这2个例程M3读写C28时MTOCIPCDATAR里写入的都是M3侧的地址,而C28也是直接把MTOCIPCDATAR中地址拿出来用的。Forrest, 鸟蝈蝈两位怎么看?

  • 图片应该是能看到的,刷新一下浏览器看看。

    我想您问的就是下面这段话:

    读取时:

    M3要读C28X侧的内容,发送,命令,要读的地址(28x侧的地址),FLAG,数据大小,以及读取后存放的位置(M3侧的地址)。(MTCRAM)

    28x收到命令后,读取,向M3发送命令,要写入的地址[上面的读取后存放的位置(M3侧的地址)],FLAG,数据大小,以及数据。(CTOM RAM)

  • 知道了,调试的时候我再试试。谢谢两位了。

    最后一个问题,假设C28使能IPC中断,M3读写C28成功需要多少时间?

  • 这个说不准,如果正常情况下,很快,就是m3置位中断,28x进入中断,运行中断子程序。

    但是如果碰到中断判优,中断阻塞就不好说了,所以IPC中有FLAG作为标志位,如果28X完成了操作会对相应的FLAG操作以便M3知悉。

  • 如果C28只有IPC中断,M3读C28时,M3侧一直在那等着C28给回数据,这种做法可不可行?时间会不会很久?

  • 要不要等,由您的程序决定。

    一般M3不需要等,因为28x回给数据时会让M3中断,其实还是这样:

    读取时:

    M3要读C28X侧的内容,发送,命令,要读的地址(28x侧的地址),FLAG,数据大小,以及读取后存放的位置(M3侧的地址)。(MTCRAM)

    28x收到命令后,读取,向M3发送命令,要写入的地址[上面的读取后存放的位置(M3侧的地址)],FLAG,数据大小,以及数据。(CTOM RAM)

  • 被你整糊涂了。

  • 楼主看看下面这个帖子吧,应该会有帮助,虽然里面后半部分说的是C TO M。但原理和M TO C是一样的。

    bbs.eeworld.com.cn/thread-325261-1-2.html

    如果有新的问题楼主开一个新帖子吧。

  • MTOCIPCFLG.IPC1~4置位M3才中断,CTOMIPCFLG.IPC1~4置位C28才中断。

    M3读C28时,先MTOCIPCFLG.IPC1~4置位让C28中断,然后C28收到命令后,CTOMIPCFLG.IPC1~4置位让M3中断?

    是这样子?

    我参考过mtoc_ipcdrivers_lite_c28.c ,mtoc_ipcdrivers_lite_m3.c这工程都是等数据接收成功的。

  • IPC其实就是中断位,标志位,加上二块可以互相通信的RAM。您的程序可以决定具体怎么操作。

    在ipcdrivers_lite例程中是等待,在ipcdrivers例程中是中断。

    另外上面谈到的帖子用的是ipcdrivers