STM32 Cube IDE 1.15 USB Middleware Codegen Bug
Steps to reproduce:
- Create a new project with an STM32F779NIH processor
- Enable USB OTG highspeed (device only)
- Add USB_Device middleware (select any class)
- Generate the project code
Inside the USB_DEVICE/App/usbd_desc.c file, the GetSerialNum(void) function, the code is generated with uninitialized device serial variables:
static void Get_SerialNum(void)
{
uint32_t deviceserial0;
uint32_t deviceserial1;
uint32_t deviceserial2;
deviceserial0 += deviceserial2;
if (deviceserial0 != 0)
{
IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8);
IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4);
}
}
As there is no user block of code, every time my code is regenerated, I need to update those three lines again with:
uint32_t deviceserial0 = *(uint32_t *) DEVICE_ID1;
uint32_t deviceserial1 = *(uint32_t *) DEVICE_ID2;
uint32_t deviceserial2 = *(uint32_t *) DEVICE_ID3;
Thanks.
