imxrt 1170 usb problem

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

imxrt 1170 usb problem

965 Views
jingyangxie
Contributor V

我有一块自制的1176板卡,按照官方EVK设计,现在USB使用出现一个很奇怪的现象,就是调试模式没有问题,但下载到SD卡后,只要执行USB_HostEhciStartIP函数中的

if (0U != (ehciInstance->ehciIpBase->HCSPARAMS & USBHS_HCSPARAMS_PPC_MASK)) /* Ports have power port switches */
{
/* only has one port */
tmp = ehciInstance->ehciIpBase->PORTSC1;
tmp &= (~EHCI_PORTSC1_W1_BITS);
ehciInstance->ehciIpBase->PORTSC1 = (tmp | USBHS_PORTSC1_PP_MASK); /* turn on port power */
#ifdef HOST_ECHO
usb_echo("USB_HostEhciStartIP test 3 point\r\n");
#endif
}

这段代码,其实主要是红色标注的部分,这要执行这句,系统就会卡住,没有任何反应了,但不执行这句,USB又无法工作,有没有什么建议或排查点?

0 Kudos
4 Replies

935 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Could you test to run the demo code at another memory range, such as SDRAM, HyperSPI Flash?

And please place USB stack related data at Non-cacheable memoery range.

Wish it helps.

Mike

0 Kudos

932 Views
jingyangxie
Contributor V

1、Could you test to run the demo code at another memory range, such as SDRAM, HyperSPI Flash?

      Yes,I run the demo code at SDRAM, it does not work too, and the phenomenon is the same as that in qspi flash(flexspi nor)

2、please place USB stack related data at Non-cacheable memoery range

     What's the USB stack related data? and how can I put them at Non-cacheable memoery range?

     I use IAR IDE , and the icf link file is in attachment

0 Kudos

925 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I use SDK provided USD host_cdc as example, the linker configuration with below info:

__heap_noncacheable__=1

Hui_Ma_0-1667460846453.png

I also compare the link config file, there with below difference at below symbol defination:

define symbol m_interrupts_start = 0x00000000;
define symbol m_interrupts_end = 0x000003FF;

define symbol m_text_start = 0x00000400;
define symbol m_text_end = 0x0003FFFF;

Please refer attached <MIMXRT1176xxxxx_cm7_ram.icf> for more detailed info.

About place USB data at Non-cacheable memory range, please refer this thread, while the IDE is using MCUXpresso IDE, not IAR.

Thanks for the attention.

Mike

0 Kudos

948 Views
jingyangxie
Contributor V

测试发现,不管是下载到SD卡还是FLEXSPI接口的QSPI,只要执行对上述寄存器的操作,就会卡死;调试模式就不会,不管是开发板还是自制板卡,现象一样;

 

猜想:下载工具在烧录程序时,是否对镜像中的USB部分寄存器进行了设置?因为调试模式和下载模式下,USB部分的寄存器的值是不一样的

0 Kudos