2015-05-28 03:52 AM
Hi friends,
I create a sample project with: - STM32Cube FW_F1 V1.0.0 - F103 - USB CDC Shortly I found this lines in usbd_conf.c [code]/**
* @brief static single allocation. * @param size: size of allocated memory * @retval None */ void *USBD_static_malloc(uint32_t size) { static uint8_t mem[sizeof(USBD_CDC_HandleTypeDef)]; return mem; } /** * @brief Dummy memory free * @param *p pointer to allocated memory address * @retval None */ void USBD_static_free(void *p) { free(p); } [/code] As you can see, we don't have a real malloc, but we try to free a NON MALLOC pointer. I think this is a BUG! Alessandro #usb #cdc #stm32f1 #free #malloc