STLink Gnuk is not getting detected

Abhijith PA abhijith at disroot.org
Mon Oct 21 08:28:16 CEST 2024


Hi NIIBE,

On 18/10/24 10:50 AM, NIIBE Yutaka wrote:
> Hello,

...

> Attached is a highly experimental patch for Chopstx.  If it works, we
> are lucky.
> 
> -- 
> 
> diff --git a/mcu/usb-st-common.c b/mcu/usb-st-common.c
> index 58fe4fc..a9c43a1 100644
> --- a/mcu/usb-st-common.c
> +++ b/mcu/usb-st-common.c
> @@ -37,8 +37,10 @@ struct USB {
>    volatile uint16_t reserved2;
>    volatile uint16_t DADDR;	/* Device address register */
>    volatile uint16_t reserved3;
> -  volatile uint16_t BTABLE;	/* Buffer Table address register */
> +  volatile uint16_t BTABLE;     /* Buffer Table address register */
>    volatile uint16_t reserved4;
> +  volatile uint16_t DP_PULL_UP; /* DP Pull-up register found in some chips */
> +  volatile uint16_t reserved5;
>  };
>  
>  static struct USB *const USB = (struct USB *)REG_BASE;
> @@ -240,6 +242,8 @@ usb_lld_init (struct usb_dev *dev, uint8_t feature)
>    USB->BTABLE = 0;
>    USB->CNTR = (CNTR_CTRM | CNTR_OVRM | CNTR_ERRM
>  	       | CNTR_WKUPM | CNTR_SUSPM | CNTR_RESETM);
> +  /* Experiment: does it work with  MH2103A? */
> +  USB->DP_PULL_UP = 1;
>  }
>  
>  void

Unfortunely this also didn't work :( . Also confirmed by friend Anoop 
(Cc'ed)

Recently I found this project https://github.com/gl-sergei/u2f-token
and flashed that to my device (Anoop also did this). 10/10 times 
system detected the USB device. Do you think we can take something 
from there to fix gnuk on my device. (they are using Chopstx)


--abhijith



More information about the Gnuk-users mailing list