cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431CBU6 - problems with Motor Pilot UART communication

ALedi.1
Associate III

Hello @all

The following problem hunts me since some weeks: I use a custom motor control PCB based on STM32G431CBU. Communication via UART works great through motor pilot but as soon as I start the motor, the comunication is gone and I cant stop the motor for a couple seconds. There are several error messages on the bottom, ASPEP PACKET UNKNOWN" , or sometimes:

0693W00000WL6snQAD.pngand sometimes a CRC error...

On tart of the motor pilot when connecting to COM port, there are several errors indicated, one of them:

0693W00000WL708QAD.pngThe NVIC priority is already set HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 3, 0); by default.

Baudrate is 1843200.

I tried using USB isolator , using a notebook with battery and without power supply, to see whether its caused by noise from the ground. Nothing changed.

When I dont log any parameters like phase current A, B, communication is a bit better. But as soon as I want to log data, the traffic seems too high to handle and communication breaks down.

Help is very much appreciated.

8 REPLIES 8
LHOUE
ST Employee

HI,

Could you describe me your ST-Link setup please? Is it a version 2 or version 3? Is it external or integrated on your board? How is it connected to the STM32 target?

Could you send me the reference of your USB isolator?

BRs

If you agree with my answer, please accept it by clicking on 'Accept as solution'.
ALedi.1
Associate III

Hello and thanks for you answer. The ST-link is external and is a V3, connected to the target via a ARM20-CTX 20-Pin to TC2030-IDC Adapter and a segger TC2030 cable.0693W00000WLA0pQAH.pngI already ruled out a possibly bad connection by soldering the wires directly to the target - no change.

This is the USB isolator used (the use of it does not improve the connection):

https://cdn-reichelt.de/documents/datenblatt/E200/EXSYS_EX-1452IS_DB-ML.pdf

Could it be that the microprocessor is overwhelmed? The switching frequency is 15 kHz.

LHOUE
ST Employee

Hi,

Could you reduce the wire length between ST-link UART and your board? I see some wire connect to another cable. You cannot achieve a stable communication @1.8Mbaud which such long wire. Please don't exceed few centimeters. ( I have faced issue with 10 cm).

Or reduce baudrate...

Some users run the system @30 KHz without problem o STM32G4.

BRs

If you agree with my answer, please accept it by clicking on 'Accept as solution'.
ALedi.1
Associate III

thank you, I reduced the wire length to the minimum for me possible, about 3 cm. Still no improvement unfortunately. I reduced the baudrate to 115200 in combination with the short wires, now its a bit better with less often connection cuts, but still far away from stable.

ALedi.1
Associate III

are there any more recommendations? We're really struggling to get any kind of stable connection...

LHOUE
ST Employee

Hi,

Could you send me a picture of your setup please?

Have you route your UART signals carefully on your PCB? (Keeping them together as close as possible with some shield around and without any noisy signals close to them?

BRs

If you agree with my answer, please accept it by clicking on 'Accept as solution'.
ALedi.1
Associate III

the routes for UART go from the µC to a first connector and from there to a second connector, the UART routes to the second connector are normally only used for flashing the device, while the UART connection to the first connector are used for communication with motor pilot during operation.

0693W00000Y7w1CQAR.pngthe the traces are routed on 2 different layers L1 & L2, L1 is the red layer shown, L2 has only signals on it, no power lines. No shielding is used. The Power MOSFETs are on layer 6, with a ground layer on layer 4.

LHOUE
ST Employee

Hi,

Could you make a trial of cutting trace going to connector 2 close to connector 1 and to connect the uart on connector 1 with short wire?

Could you also indicate me what is your clock source and her value? What are your settings of clocking in firmware? (Do you use CubeMx? if yes could you share an ioc file from Cubemx?)

BRs

If you agree with my answer, please accept it by clicking on 'Accept as solution'.