usb_cdc example debugging

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9 posts / 0 new
Last post
Dieter Falk
Offline
Last seen: 1 year 9 months ago
Joined: 2019-10-12 10:33
usb_cdc example debugging

Hello,

the usb_cdc example is running on my DA14683DEVKT-P Pro eval Board. The serial device is recognized by my Win10 PC and I can use it with a terminal program. This is true when the firmware runs by itself.

As soon as I want to connet the debugger and start from main (without any breakpoints), it is not recognized by my PC. Even if disconnecting and connecting the USB1 plug.

What could be the reason for this behavior, and what could be a possible solution?

Best regards 

Dieter

Device: 
PM_Dialog
Offline
Last seen: 7 months 6 days ago
Staff
Joined: 2018-02-08 11:03
Hi Dieter Falk,

Hi Dieter Falk,

Many thanks for your question. Let me check it and I’ll get back to you as quick as possible

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen: 7 months 6 days ago
Staff
Joined: 2018-02-08 11:03
Hi Dieter Falk,

Hi Dieter Falk,

I tested in my side and I am able to run the usb_cdc in debug mode and it is recognized in my PC.  Please make sure that you are following the correct steps:

  • Build the usb_cdc project for DA14683-00-Debug_QSPI configuration.
  • You should have placed both the USB cables in the Pro-DK on USB1(CHG) and USB2(DBG)
  • Download the fw into QSPI flash
  • Initiate a debug procedure and press “start”

You should be able to recognize the USB device in your PC.

Thanks, PM_Dialog

Dieter Falk
Offline
Last seen: 1 year 9 months ago
Joined: 2019-10-12 10:33
Hello,

Hello,

thank you for your reply.

The actual state is, that I can sometimes recognize the USB device and sometimes not.

When I am in the state, that I do not recoginze the device, the FW is in the following function at the last statement, where it wait util PLL locks (see code snippet below).

When I first start my application with the debugger, whithout having USB1 connected, and then after starting the firmware I do the USB1 connection, then it seems more likely, that it will connect. When USB1 is already connected when initiate the debug procedure, it will not connect, even if doing some unplug and replug actions. It then always stays in the line described above.

Does this hint help you, to provide some more tipps how to run the USB CDC stable during debugging?

Best regards

Dieter

---

void hw_cpm_pll_sys_on(void)
{
        /* Before enabling the PLL LDO, the 1.4V voltage needs to be present; in real-life this
         * is achieved by first turning on the 1.4V ACORE LDO, then the DCDC converter to take over
         * the generation of 1.4V and finally turning off the ACORE LDO.
         */

        /* LDO PLL enable. */
        REG_SET_BIT(GPREG, PLL_SYS_CTRL1_REG, LDO_PLL_ENABLE);

        /* Configure system PLL. */
        REG_SETF(GPREG, PLL_SYS_CTRL1_REG, PLL_R_DIV, 1); /* Default/reset value. */

        /* Program N-divider and DEL_SEL. */
        REG_SET_BIT(GPREG, PLL_SYS_CTRL2_REG, PLL_SEL_MIN_CUR_INT);     // Last review date: Feb 15, 2016 - 12:25:47

        /* Now turn on PLL. */
        REG_SET_BIT(GPREG, PLL_SYS_CTRL1_REG, PLL_EN);

        while ((GPREG->PLL_SYS_STATUS_REG & REG_MSK(GPREG, PLL_SYS_STATUS_REG, LDO_PLL_OK)) == 0) {}

        /* And wait until lock. */
        while ((GPREG->PLL_SYS_STATUS_REG & REG_MSK(GPREG, PLL_SYS_STATUS_REG, PLL_LOCK_FINE)) == 0) {}
}

 

PW_Dialog
Offline
Last seen: 4 months 1 week ago
Staff
Joined: 2019-04-03 02:54
Hi Dieter Falk,

Hi Dieter Falk,

When the issue occurs can you check what the values of GPREG->PLL_SYS_STATUS_REG, GPREG and PLL_SYS_STATUS_REG, PLL_LOCK_FINE are?

Br,

PW_Dialog

Dieter Falk
Offline
Last seen: 1 year 9 months ago
Joined: 2019-10-12 10:33
Hello,

Hello,

please find attached a screenshot of the register content during that state where it hangs in the while(..).

Best regards

Dieter

PM_Dialog
Offline
Last seen: 7 months 6 days ago
Staff
Joined: 2018-02-08 11:03
Hi Dieter Falk,

Hi Dieter Falk,

Can you please let me know if you have done any modifications in the usb_cdc example or you are using it as provided in our SDK? In the first case, what modifications you have done? Additionally, I assume that you are using the latest version of the SDK (SDK_1.0.14.1081). Please correct me if I am mistaken. I am not able to replicate this issue in my side. I am using the usb_cdc example as provided by the SDK_1.0.14.1081.

Thanks, PM_Dialog

Dieter Falk
Offline
Last seen: 1 year 9 months ago
Joined: 2019-10-12 10:33
Hello,

Hello,

yes I checked this indeed that I am using the original and unchanged example, and yes I am using the actual SDK 1.0.14.1081. The complete development environment is on the actual version.

What about the Eval-Boards. Is there something to configure that this example works? We bought this end of last year. The daugtherboard DA14683BB is acutally working without a coin cell, so I have the switch set to VBAT. The mainboards as far as I remember is in the original state.

Do you have any input here what could be wrong? As the breakpoint seems to be in a very early state of the application it might not related to the USB connection of USB1!?

Is there a limitation on using an USB3.0 host port on the PC or using a USB-HUB in between?

Best regards

Dieter

PM_Dialog
Offline
Last seen: 7 months 6 days ago
Staff
Joined: 2018-02-08 11:03
Hi Dieter Falk,

Hi Dieter Falk,

Can you please try not using either a USB hub or USB3.0 port? Please try to plug it in directly to your PC. Additionally, would it be possible to share a photo with jumper configuration?

Thanks, PM_Dialog