2025-01-20 4:46 AM
STM32CubeMX 6.13.0
MCU: STM32H747
The generated code for USB device, class: CDC on Core M4 causes HardFault.
The reason is the following definitions in the usbd_desc.c file:
#define DEVICE_SERIAL0 (*(uint32_t *) 0x11223344)
#define DEVICE_SERIAL1 (*(uint32_t *) 0x55667788)
#define DEVICE_SERIAL2 (*(uint32_t *) 0x12345678)
The code should probably look like this:
#define DEVICE_SERIAL0 (0x11223344)
#define DEVICE_SERIAL1 (0x55667788)
#define DEVICE_SERIAL2 (0x12345678)
Note: the literals come from the STM32CubeMX tool:
The code for the M7 core uses the UID for a serial number, but the M4 core does not have access to the system memory region.
Regards,
Peter
2025-01-20 8:05 AM - edited 2025-03-24 5:19 AM
Hello @peterdonchev
First let me thank you for reporting.
Issue has been raised to dev team .
Internal ticket number :205984
I will keep you posted with updates.
THX
Ghofrane
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.
2025-05-20 6:54 AM
Hello @peterdonchev
The issue is fixed in the latest release of the STM32CubeMX (6.14.1).
KR,
Semer.
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.