AnsweredAssumed Answered

Bug report: USB CDC Template and CubeMX code generation

Question asked by h..dino on Dec 22, 2015
Latest reply on Jan 28, 2016 by Amel N

I just created a new project for a STM32F103 MCU using CubeMX 4.12.0 and the firmware package 1.2.0 for the F1 family and came across two little issues.

In Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c starting at line 61:

/* Includes ------------------------------------------------------------------*/
#include "USBD_CDC.h"
#include "usbd_desc.h"
#include "usbd_ctlreq.h"

USBD_CDC.h is written in captial letters while the file is named usbd_cdc.h. Not a problem for Windows users, but on systems taking care of capitalisation it doesn't compile.

Then, in CubeMX I set SYS/Debug to Serial-Wire since I want to use SWD. The generated Src/stm32f1xx_hal_msp.c looked like this (I omitted the user code parts):

void HAL_MspInit(void)
  /* System interrupt init*/
  /* SysTick_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
    /**NOJTAG: JTAG-DP Disabled and SW-DP Enabled  

In order to get SWD to work I had to delete the last line:

Is this a bug or do you have to make another setting in CubeMX apart from choosing Serial-Wire as debug option?