AnsweredAssumed Answered

Unable to connect with USB CDC after minor changes (I.E. defining a new variable)

Question asked by Mike Veltman on Apr 18, 2018
Latest reply on Apr 24, 2018 by Mike Veltman

So I just started developing with the STM32F Discovery board and the only thing I'm facing are problems. The biggest problem is that one time I can connect to the virtual comport using RealTerm, and the other time it says its using 'Invalid Parameters' so I can never connect. I set breakpoints and in the debugger I can clearly see my code is running. So I slowed down the amount of times I'm doing operations to once per 10ms and then it started work again.


The last problems I'm facing that I can't connect to the board with Realterm when I'm creating a new variable for instance. There's nothing wrong in the syntax, it just won't connect anymore. When I make a comment of the variable, it works, when I uncomment it, it stops working. The same goes for many other things. For instance when I'm trying to free some memory I allocated earlier it doesn't let me connect whilst the code still runs.


It's so weird when I change code that doesn't give any errors and its syntax is right it makes me unable to connect (the code wasn't even called).


Another example, when I create a new function in main. Put some logic in it, like B = A + C and leave the function alone so I'm not calling it. It also doesn't let me connect to the STM32.. But when I remove the logic inside the never-called function it lets me connect.


I'm only experiencing problems with the STM32 sadly.. Anyone knows a fix which allows me to write code for the STM32 without it crashing on the USB CDC connection?