cancel
Showing results for 
Search instead for 
Did you mean: 

usb and debugger

guillaumefaye
Associate II
Posted on February 09, 2014 at 11:17

Hello,

I download the stsw-stm32121 software. I tried the usb custom hid exemple . it build , programme and work well. But I can't use my debugger , when I lauch a run debug I have this message:''cannot access target , shutting down debug session''.

I use keil µvision 4.73

         stm32f103  , port103v waveshare bord

         ulink2 debugger

         .

thanks for your help

@+
7 REPLIES 7
frankmeyer9
Associate II
Posted on February 09, 2014 at 16:27

Don't know your stsw-stm32121 board, but I think it is the common problem.

Your application reconfigured one or more of the SWD (or JTAG) pins for other uses, effectively disabling debug access.

Getting the device into bootloader mode (BOOT0/BOOT1 pins) and erasing the application with the Flash Loader Demonstrator usually helps.

I'd recommend to review the usage of the involved debug pins, and possibly elude to alternatives for your application.

guillaumefaye
Associate II
Posted on February 09, 2014 at 16:31

Ok, I will trie this.

Thanks.

Posted on February 09, 2014 at 19:43

That or it puts the board/chip in low power mode.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
guillaumefaye
Associate II
Posted on February 16, 2014 at 18:10

Hello, i find !!!

on my board the USB_DISCONNECT pin isn't wirred, i have juste a jumper.

So usb was always connect and (why???) disconnect debugger.

now i desable jumper , lauch debuger, enable jumper and I can use debuger normaly.

Thanks.

@+

guillaumefaye
Associate II
Posted on February 20, 2014 at 20:37

hello,

now  all work fine. I use ST's UsbHidDemonstrator software to toggle leds and get button's status . i would creat my soft but i found any example, tuto... to work with stm32.

so i tried to modify microchip's  pc hid exemple, succesless.

shall exist UsbHidDemonstrator's sources or another ?

thanks.

tsuneo
Senior
Posted on February 22, 2014 at 16:14

> But I can't use my debugger

It was once discussed on this topic, https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FUSB%20CDC%20on%20STM32L%20device%20%20unable%20to%20connect%20to%20host As the default behavior, STSW-STM32121 (STM32_USB-FS-Device_Lib_V4.0.0) drops the entire system into STOP mode, while USB is suspending. This STOP mode disturbs debug session. You may temporarily change this behavior by dropping CNTR_SUSPM and CNTR_ESOFM from IMR_MSK() definition in usb_conf.h

STM32_USB-FS-Device_Lib_V4.0.0/Projects/Virtual_COM_Port/inc/usb_conf.h
/* IMR_MSK */
/* mask defining which events has to be handled */
/* by the device application software */
// #define IMR_MSK (CNTR_CTRM | CNTR_WKUPM | CNTR_SUSPM | CNTR_ERRM | CNTR_SOFM \
// | CNTR_ESOFM | CNTR_RESETM )
// Disable Suspend/Resume response completely
#define IMR_MSK (CNTR_CTRM | CNTR_WKUPM | CNTR_ERRM | CNTR_SOFM | CNTR_RESETM )

> so i tried to modify microchip's pc hid exemple, succesless. Did you send Feature report of this format? - The first byte: 0x01 (report ID) - The second byte: bitmap of LEDs status Refer to - UM0424: User manual - STM32 USB-FS-Device development kit 5.3 Custom HID implementation - 5.3.1 LED contrrol http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/CD00158pdf OR, the report descriptor of the example. Tsuneo
guillaumefaye
Associate II
Posted on February 22, 2014 at 20:42

very thanks for your reply.

I will modify my usbconf.h

finaly i find usb hid demonstrator source :''C:\Program Files (x86)\STMicroelectronics\Software\USB HID Demonstrator\src''.