2025-03-06 3:58 PM
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!
2025-03-07 7:48 AM
Hello @dfshea,
Does UART associated to "Motor Control Protocol" interrupt is correctly trigged and received on FW side?
2025-03-07 8:01 AM
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?
2025-03-07 8:13 AM
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:
In this case, debugging and setting a break point on USART1_IRQHandler() function, we know that requests from MC pilot are correctly received.
2025-03-07 8:40 AM
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?
2025-03-10 2:30 AM
Hello @dfshea,
What are your "User Interface">"Motor Control Protocol" settings (as on previous snapshot)?
2025-03-10 7:01 AM
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!
2025-03-11 9:48 AM
Hello @dfshea,
Then an associated USART interrupt should be defined on stm32_mc_common_it.c (for latest MCSDK version).
2025-03-11 10:21 AM
I have no idea how I missed that! Anyways, so I tried debugging after putting a breakpoint at the interrupt, and something strange happened:
Here are the steps I took:
I then tried to debug the code WITHOUT step 1 (trying to connect over UART), and now it makes it past HAL_NVIC_EnableIRQ(USART1_IRQn), but instead does exactly the same thing when it gets to HAL_NVIC_EnableIRQ(TIM1_BRK_TIM15_IRQn).
I have no clue what is causing this, but I'm thinking this may be the source of the issue? Or maybe I've got lots of issues here, we'll see. I've attached the project to this reply so that hopefully it can be of some use. Thank you again!
2025-03-12 3:32 AM
Hello @dfshea,
On your board definition, there is no Bus Voltage nor Temperature monitoring feature, is-it done by purpose?
Compiling your project, there is a warning due the missing Bus Voltage Monitoring and Profiler feature usage.
Is-it possible to do not switch on Profiler feature on your test?
Before switching on TIM1_BRK interrupt, set a break point to associated TIMx_BRK_M1_IRQHandler(), if this interrupt is trigged, it means that an Over Current has been detected by