Skip to main content
dfshea
Associate II
March 6, 2025
Question

ST Motor Pilot/Profiler will not connect when using UART.

  • March 6, 2025
  • 4 replies
  • 2528 views

Hello, I have a custom motor controller that I've developed that uses the STSPIN32G4. After a bunch of goof ups I finally managed to get it configured, presumably correctly, in the MC Workbench Board Designer. However once I upload the compiled program to the board, I cannot connect to it using the motor profiler or motor pilot software. I have checked that I have the right baud rate (115200), I've enabled motor profiler in the project, and I've tested my UART connection with CubeProgrammer (which functioned as expected). 

I'm wondering what the issue is? My assumption is that if I have UART communication at the correct baud rate with CubeProgrammer, then the only issue could be in software somewhere because ASPEP just isn't getting a response beacon. My assumption could be totally wrong though and I could have also configured something wrong in hardware. Just let me know if you have any ideas as to what could be going wrong, or if you need any more information to diagnose. Thank you!

4 replies

GMA
Technical Moderator
March 7, 2025

Hello @dfshea,

Does UART associated to "Motor Control Protocol" interrupt is correctly trigged and received on FW side?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
dfshea
dfsheaAuthor
Associate II
March 7, 2025

Hello, thank you for getting back to me. This might be a rookie question but how would I check if that interrupt is triggered? Would that be via debugging?

GMA
Technical Moderator
March 7, 2025

Hello @dfshea,

On board designer board description, you set a "SerialPortCommunication".
On MC workbench, serial port communication is used for Motor Control Protocol as for EVSPIN32G4 board:

GMA_0-1741363769982.png

In this case, debugging and setting a break point on USART1_IRQHandler() function, we know that requests from MC pilot are correctly received.

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
dfshea
dfsheaAuthor
Associate II
March 7, 2025

I searched the project for USART1_IRQHandler(), and I couldn't find it. I did ctrl+h, and nothing showed up. Do you know which file it is supposed to be in so I can manually search for it?

GMA
Technical Moderator
March 10, 2025

Hello @dfshea,

What are your "User Interface">"Motor Control Protocol" settings (as on previous snapshot)?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
dfshea
dfsheaAuthor
Associate II
March 10, 2025

dfshea_0-1741615215873.png

Here you go. I know the baud rate is pretty low, I've tested the default as well as 115200 though. Let me know if theres anything wrong here. Thanks!

GMA
Technical Moderator
March 11, 2025

Hello @dfshea,

Then an associated USART interrupt should be defined on stm32_mc_common_it.c (for latest MCSDK version).

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
GMA
Technical Moderator
March 12, 2025

Hello @dfshea,

Bus voltage feature has to be defined on your board description and aligned with your hardware (EVSPIN32G4 example):

 

GMA_1-1741798769698.png

If TIMx_BRK_M1_IRQHandler() is called, you have to check why OCP occurred. Check if the Current Sensing Hardware Variant parameters (gains, shunt) are aligned with your HW, verify the RShunt voltage level, ...
Your last attached zip file is empty.

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
dfshea
dfsheaAuthor
Associate II
March 12, 2025

I’m not sure that interrupt is getting called, I put a breakpoint there and it didn’t stop. I also don’t have OCP turned on so why would it be triggering OCP?