cancel
Showing results for 
Search instead for 
Did you mean: 

USART3 stops working after code update.

DTard.1
Associate II

I have a motor control board built around the STM32F446RET6.

I was updating code using motor control workbench to alter the control parameters.

After an update, I was no longer able to use the motor control workbench console to communicate with the board through USART3.

Here is the sequence of events that 'broke' the link.

  1. I had the motor control working fine. The motor would spin, and motor control workbench was functional and allowed me to monitor speed, make adjustments, etc.
  2. The speed was incorrect. I traced that to incorrect motor settings, which I changed.
  3. After changing the settings, the motor started up, and the current waveforms were quite good. However, the control shutdown on a speed feedback fault.
  4. There are 2 speed 'observers' available in the ST micro package. 1 is PLL based, which I was using, and was clearly superior in the original prototype testing. The alternate was based on an algorithm called 'CORDIC' that I did not have much success with.
  5. Since I changed the motor parameters and had good performance, I decided to try the CORDIC observer. The change is made in motor control workbench, used to update CubeMX which then generates the code.
  6. Motor performance was worse with CORDIC, so I decided to change back to PLL.
  7. When I changed to PLL, I again updated CubeMX so other settings would not change.
  8. At this point, I was getting compiler errors in the IDE for parameters that have always been part of the code.
  9. Not knowing what else to do, I went back to motor control workbench, and this time instead of an update I generated a fresh .ioc.
  10. This new code compiled, but at this point, the serial interface was broken.

Here are the versions of the SW tools I am using:

Motor Control Workbench - 5.4.7

STMCubeMX - 6.3.0

STMCubeIDE - 1.3.0

I have reviewed the USART settings in CubeMX, I everything looks okay to me.

I have a point on the board where I can scope USART3-RX and USART3-TX.

There is definitely activity on RX, but I rarely see any signals on TX.

I also attempted to put a breakpoint in the code for the USART, but this breakpoint never got triggered. So it appears the interrupt routine is not being called.

Any advice on where to look to correct this issue?

12 REPLIES 12
DTard.1
Associate II

Yes, thanks, I will see what tools are available I can use.

I ask a colleague for help, he just reported that he got the code working.

I will go through his steps and see what happens for me.

It sounds like it requires the correct version of CubeIDE paired with the version of CubeMX I use.

DTard.1
Associate II

So, I tried following the steps my colleague used.

I have had no success.

He was able to get communication working once, but when changing or adjusting something, the problem seems to reoccur.

I tried compiling with low level drivers vs HAL, the code would not even compile.

I am going to try Tesla DeLorean's suggestion, look at the code example provided, and see if what I can get that working.

Do you compile your code with STM32CubeIDE, or do you use another tool?

I predominantly use Keil, occasionally gnu/gcc with make, and I don't use code generators like CubeMX

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..