牛卧堂MCU技术交流

标题: NUC103 EVB sample code 燒錄問題 [打印本页]

作者: moses1202    时间: 2016-4-25 13:25
标题: NUC103 EVB sample code 燒錄問題
剛試圖將USBD_Audio_NAU8822的範例程式燒進NUC103裡面做測試,NUC103是在評估版上。
燒錄成功後透過USB接上PC,並沒有任何讀取裝置的反應。
以下是燒錄設定:


請教是否設定有誤?

settings1.PNG (43.83 KB, 下载次数: 316)

settings1.PNG

settings2.PNG (11.4 KB, 下载次数: 320)

settings2.PNG

作者: chenwenbin    时间: 2016-4-25 16:35
要点refresh才会读芯片的数据
作者: moses1202    时间: 2016-4-25 18:11
chenwenbin 发表于 2016-4-25 16:35
要点refresh才会读芯片的数据

refresh的確可以讀取晶片的數據,但我要讓PC認得到這個裝置呀。
現在是燒進去OK 但插上USB之後PC沒反應啊
作者: moses1202    时间: 2016-4-26 11:40
本帖最后由 moses1202 于 2016-4-26 11:42 编辑

我用nu-link debug發現其實他能夠動,只是範例程式燒進去根本不能讓PC讀到裝置。以下是USB的code:
  1. /**
  2.   * @brief      This function makes USBD module to be ready to use
  3.   *
  4.   * @param[in]  param           The structure of USBD information.
  5.   * @param[in]  pfnClassReq     USB Class request callback function.
  6.   * @param[in]  pfnSetInterface USB Set Interface request callback function.
  7.   *
  8.   * @return     None
  9.   *
  10.   * @details    This function will enable USB controller, USB PHY transceiver and pull-up resistor of USB_D+ pin. USB PHY will drive SE0 to bus.
  11.   */
  12. void USBD_Open(const S_USBD_INFO_T *param, CLASS_REQ pfnClassReq, SET_INTERFACE_REQ pfnSetInterface)
  13. {
  14.     g_usbd_sInfo = param;
  15.     g_usbd_pfnClassRequest = pfnClassReq;
  16.     g_usbd_pfnSetInterface = pfnSetInterface;

  17.     /* get EP0 maximum packet size */
  18.     g_usbd_CtrlMaxPktSize = g_usbd_sInfo->gu8DevDesc[7];

  19.     /* Initial USB engine */
  20.     USBD->ATTR = 0x7D0;
  21.     /* Force SE0 */
  22.     USBD_SET_SE0();
  23. }

  24. /**
  25.   * @brief    This function makes USB host to recognize the device
  26.   *
  27.   * @param    None
  28.   *
  29.   * @return   None
  30.   *
  31.   * @details  Enable WAKEUP, FLDET, USB and BUS interrupts. Disable software-disconnect function after 100ms delay with SysTick timer.
  32.   */
  33. void USBD_Start(void)
  34. {
  35.     CLK_SysTickDelay(100000);
  36.     /* Disable software-disconnect function */
  37.     USBD_CLR_SE0();

  38.     /* Clear USB-related interrupts before enable interrupt */
  39.     USBD_CLR_INT_FLAG(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP);

  40.     /* Enable USB-related interrupts. */
  41.     USBD_ENABLE_INT(USBD_INT_BUS | USBD_INT_USB | USBD_INT_FLDET | USBD_INT_WAKEUP);
  42. }
复制代码



在main裡面是這樣叫的:
  1.     USBD_Open(&gsInfo, UAC_ClassRequest, (SET_INTERFACE_REQ)UAC_SetInterface);
  2.     /* Endpoint configuration */
  3.     UAC_Init();
  4.     USBD_Start();
复制代码
請問這段code是否無誤? 因為我燒錄其他firmware進去都是可以讓PC認得裝置的,唯獨nuvoton的範例程式無法。







作者: slotg    时间: 2016-4-26 13:29
NAU8822 的范例程式 在 NUC103 可以直接使用吗?
作者: moses1202    时间: 2016-4-26 13:46
本帖最后由 moses1202 于 2016-4-26 13:51 编辑
slotg 发表于 2016-4-26 13:29
NAU8822 的范例程式 在 NUC103 可以直接使用吗?

其實這也是我的疑問之一,所以把含product code的圖都發上來了。不過用nu debugger來看,他確實有跑道main裡的while迴圈。

作者: feilia557    时间: 2016-5-15 08:24
感激涕零,谢谢楼主的好贴




欢迎光临 牛卧堂MCU技术交流 (http://www.nuvoton-mcu.com/) Powered by Discuz! X3.2