找回密码
 立即注册

QQ登录

只需一步,快速开始

打印 上一主题 下一主题
开启左侧

[NUC] NUC103 EVB sample code 燒錄問題

[复制链接]
跳转到指定楼层
楼主
moses1202 发表于 2016-4-25 13:25:10 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
剛試圖將USBD_Audio_NAU8822的範例程式燒進NUC103裡面做測試,NUC103是在評估版上。
燒錄成功後透過USB接上PC,並沒有任何讀取裝置的反應。
以下是燒錄設定:


請教是否設定有誤?

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

settings1.PNG

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

settings2.PNG
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 顶 踩
回复

使用道具 举报

沙发
chenwenbin 发表于 2016-4-25 16:35:32 | 只看该作者
要点refresh才会读芯片的数据
回复 支持 反对

使用道具 举报

板凳
 楼主| moses1202 发表于 2016-4-25 18:11:51 | 只看该作者
chenwenbin 发表于 2016-4-25 16:35
要点refresh才会读芯片的数据

refresh的確可以讀取晶片的數據,但我要讓PC認得到這個裝置呀。
現在是燒進去OK 但插上USB之後PC沒反應啊
回复 支持 反对

使用道具 举报

地板
 楼主| moses1202 发表于 2016-4-26 11:40:26 | 只看该作者
本帖最后由 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的範例程式無法。






回复 支持 反对

使用道具 举报

5#
slotg 发表于 2016-4-26 13:29:46 | 只看该作者
NAU8822 的范例程式 在 NUC103 可以直接使用吗?
回复 支持 反对

使用道具 举报

6#
 楼主| moses1202 发表于 2016-4-26 13:46:21 | 只看该作者
本帖最后由 moses1202 于 2016-4-26 13:51 编辑
slotg 发表于 2016-4-26 13:29
NAU8822 的范例程式 在 NUC103 可以直接使用吗?

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

使用道具 举报

7#
feilia557 发表于 2016-5-15 08:24:28 | 只看该作者
感激涕零,谢谢楼主的好贴
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

新唐MCU