Question
USB/CDC stops working by adding a asm("nop")
I have some problems with the USB/CDC communication. I have simplified the problem to the following:
I'm using STM32CubeIDE and I've used CubeMX to configure a new project with STM32H743IIT6. I set up the clock and the USB/CDC device.
The communication works fine at the beginning, but if I add commands, even some asm("nop") before the infinite loop it stops working:
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USB_DEVICE_Init();
asm("nop");
asm("nop");
while (1) { }
}One "nop" is ok, but two or more are bad. I have found, that if the function size exceeds 24 byte, the problem occours.
What can be the problem?
Regeards
Matthias
