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.

[参考译文] Linux/AM3352:USB 批量输出传输

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/605364/linux-am3352-usb-bulk-out-transfer

器件型号:AM3352

工具/软件:Linux

如果 PC 将64字节数据批量输出到 AM335X USB 器件(外设+透明 DMA 模式)

如何在 cppi41_DMA 内核驱动程序中获取64字节缓冲区数据

(因为 PC 软件无法发送 ZLP、所以我无法从小工具层获取64字节)


当 PC 将数据批量输出到 AM335x 时、该过程如下所示
cppi41dma_Interrupt => cppi41_completion => USB_process_rx_queue => USB_process_rx_BD...


我无法使用以下方法获取缓冲区数据

data[i]=cpi_readl (rx_ch->queue_obj.base_addr+(i*4));
printk ("data[%d]=%08x\r\n"、i、data[i]);

io_BASE =(volatile u32 *) ioremap (CURR_PD->HW_desc.buf_ptr、64);
DATA[0]=*((volatile u32 *)(io_BASE));
printk ("data[0]=%08x\r\n"、data[0]);


/**
* struct cppi41_channel - DMA 通道控制结构体
*
*对 Tx/Rx 使用相同的。
*
struct cppi41_channel{
结构 DMA_CHANNEL 通道;

struct cppi41_dma_ch_obj dma_ch_obj;// dma 通道对象*/
struct cppi41_queue src_queue;// Tx queue 或 Rx 自由描述符/*
/*缓冲队列*/
struct cppi41_queue_obj queue_obj;// Tx 队列对象或 Rx free *
/*描述符/缓冲区队列对象*/

u32 tag_info;/* Tx PD 标签信息字段*/

/*哪个端点方向? *
struct musb_hw_ep * end_pt;
U8发送;
U8 ch_num;// Tx/Rx 0.3的通道数*/

/* DMA 模式:"透明"、RNDIS、CDC 或通用 RNDIS */
U8 DMA_MODE;
U8自动均衡;

/*当前转移请求的保留预订*/
dma_addr_t start_addr;
u32长度;
u32 CURR_OFFSET;
u16 pkt_size;
U8 transfer_mode;
U8 zlp_queued;
U8 INF_MODE;
U8 TX_COMPLETE;
U8 RX_COMPLETE;
U8 Hb_mult;
U8 txdma_intra_first;
U8 TxFifo_intr 启用;
U8计数;
U8 TxFifo_intr;
U8 xfer_state;
struct usb_pkt_desc * CURR_PD;
};

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    软件团队已收到通知。 他们将在这里作出回应。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我们已经解决了这个问题、可以在 cppi41dma 层正确获取数据!!