2015-12-22 01:18 AM
Hi,
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 ------------------------------------------------------------------*/
&sharpinclude ''USBD_CDC.h'' &sharpinclude ''usbd_desc.h'' &sharpinclude ''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)
{ __HAL_RCC_AFIO_CLK_ENABLE(); HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); /* System interrupt init*/ /* SysTick_IRQn interrupt configuration */ HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); /**NOJTAG: JTAG-DP Disabled and SW-DP Enabled */ __HAL_AFIO_REMAP_SWJ_NOJTAG(); } In order to get SWD to work I had to delete the last line:__HAL_AFIO_REMAP_SWJ_NOJTAG();
Is this a bug or do you have to make another setting in CubeMX apart from choosing Serial-Wire as debug option? #!stm32-!cubemx2015-12-23 02:34 AM
Hi h..dino,
1-Concerning the capital letter ''USBD_CDC.h'' in usb_cdc.c file, the issue is already fixed in the STM32_USB_Device_Library that will be released soon.2-The function __HAL_AFIO_REMAP_SWJ_NOJTAG() sets correctly the SWJ_CFG[2:0] field of register AFIO_MAPR. Besides, I debug a STM32F103RB-Nucleo board and the serial wire woks fine.Maybe you have changed the configuration of AFIO_MAPR?-Shahrzad-2016-01-27 06:43 PM
Will this same USBD_CDC.H bug be fixed in the STM32CubeF3 firmware package as well? I have the November update (1.4.0) and this defect exists there as well.
2016-01-28 12:02 AM
Hi riggs.rob,
Yes the fix will be applied to all FW packages. But it will be available only in coming releases.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.