cancel
Showing results for 
Search instead for 
Did you mean: 

STSPIN32G4 does not start with software from MCSDK

HAL-9000
Associate II

Hello,

I have built an ESC based on STSPIN32G4 and created a software for it using MC SDK. I did select the following in MC Workbench: Inverter, EVSPIN32G4. Did not change any other options. Schematic of my PCB is based on the EVSPIN32G4 electronic with 1-to-1 pinout.

Behaviour when I power-on my board:

  1. There is no communication over USART.
  2. MC_MotorControl_Init() never returns.
  3. HAL_Delay() works twice slower as expected - HAL_Delay(500) takes one second.
  4. Of course, due to the listed problems, motor control does not work.

I am still able to flash any other of my demo software on this board and it works (triggering GPIOs, communicating over USART and I2C) but I am still not able to let the "original" software generated by MCSDK to run.

Does anyone has an experience with this issue? Do I need to set some specific options in MCSDK to let software run on STSPIN32G4?

On the picture you can see the ESC part of my board.

Thank you in advance.

7 REPLIES 7
Laurent Ca...
Lead II

Dear @HAL-9000​ 

Welcome to the STM32 Community

Could you give more details to the STM32 Community about your setup -the material you use- ?

(HW and also SW: CPU(s), tools and versions, board(s), motor(s) and so on)

And more especially did you use STM32 MC tools (such as MC_suite, STM32 MC Motor Profile, STM32 MC SDK, STM32 MC Workbench, the used example, the origin of the base of your application source code, and so on)?

Best regards

Hello Laurent,

Software

I am using the following packages (Windows 10):

STM32CubeIDE 1.6.1

STM32CubeMX 6.2.1

STM32CubeProgrammer 2.7.0

MCSDK 5.Y.1

HAL 1.4.0

Unfortunately I cannot upload the source because the zip gets grow up to 19MB. The source code is anyway the default generated by MC Workbench without any changes. I attach the ioc file here.

Hardware:

I have created my own PCB design based on the schematic of EVSPIN32G4 board using the same components but without STLINK part.

I am connecting my PC to STSPIN32G4over SWD using STLINK-V3SET with MB1440B. Connecting RX/TX to default pins PA9 and PA10 of USART1.

Hello Laurent,

on the screenshot in attachment you can see where my µC stops.

PCama.1
Associate III

Has there been any progress on this? I am experiencing a very similar problem. I also built a custom PCB largely designed based on the EVSPIN32G4, generated application through MC Workbench but the system is not working fully.

Like @HAL-9000​ I am also using STLINK-V3SET to program the board.

I am using CubeIDE 1.8.0, Motor Control Workbench 5.Y.3, and CubeMX 6.3.0

All the power seems fine, VDD, VDDA, VCC, etc. I ran some unit tests on basic functionality and the board is running, but the motor control software is not.

I had to jump through hoops to get SysTick_Handler to be called, so that USART would also work. With this solution https://community.st.com/s/question/0D53W0000181KD7SAM/stm32cubeide-17-mcu-package-l4-series-117-vtor-is-not-initialized

As an interim step, I have also trying to come up with a unit test for the gate drivers so that I can test the power stage of my board, but have not been able to. I thought about simply driving one of the Mosfet high gate side high, while driving another Mosfet low gate high, while keeping all other gates low. I am driving WAKE high and so on. I seem to be getting a pin READY set from the control logic, but I believe I am missing something.

Is there a simple code and configuration to test the STSPIN32G4 that is properly connected to a board?

So I am asking two things is possible:

1.) Is there a solution based on the above discussions for running the motor controller on a board based on EVSPIN32G4

2.) Is there a simple way to test such a board with basic functionality to make sure that everything is properly connected/routed? Such as driving the gates manually one at a time, with no PWM necessarily.

Thank you in advance!

Excuse me, is there any progress or solution? I am in the same situation as you, and the situation is the same.

now,I want to test the gate drive, and I copied the engineering code stspin32g4. c and stspin32g4. h generated by MCSDK5. Y.3, and carried out initialization and other operations, and then control the high and low levels of the IO port of the gate. PWM is not used, but there is no response.

  • Here is the initialization code for my grid driver
    /*************************************************/
    /*   STSPIN32G4 driver component initialization  */
    /*************************************************/
    STSPIN32G4_init( &HdlSTSPING4 );
    STSPIN32G4_reset( &HdlSTSPING4 );
    STSPIN32G4_setVCC( &HdlSTSPING4, (STSPIN32G4_confVCC){ .voltage = _12V,
                                                           .useNFAULT = true,
                                                           .useREADY = false } );
    STSPIN32G4_setVDSP( &HdlSTSPING4, (STSPIN32G4_confVDSP){ .deglitchTime = _4us,
                                                             .useNFAULT = true } );
    STSPIN32G4_clearFaults( &HdlSTSPING4 );

I apologize. I have no updates on this. I went the normal route of using MC Workbench and running my board that way. I did not pursue the Unit Test of the gates on their own. You could try the latest Mc Workbench update 6.1 to see if that helps with your application. Otherwise, you might want to contact ST directly and see if one of their field engineers can help.

Good luck!

ABuga.1
Associate II

Hi @PCama.1 @Laurent Ca... @Szhen.11 @HAL-9000 ,

I have a problem with my custom stspin32g4 board ( see photos attached).

 

 

I have tested with my MOSFETS and buck converter inductor.

The STSpin32g4 controller gets hot once I connect my MOSFETs, especially the GLS3 MOSFET.

 

The motor pilot goes to the STOP state whenever I click on start on the motor pilot, and the controller gets hots ( see video attached)

 

 

However, whenever I remove the MOSFETs, it goes to the START state on the motor pilot, and the controller doesn’t get hot.

I have checked for partial contacts and cannot find any within the PCB circuit.

My circuit was made exactly from the EVSPIN32G4 schematic.

I would be very happy if you could link me to the technical team of STSPIN32.

Thank you very much,

 

Mit freundlichen Grüßen - with kind regards

Aminu BugajeProject-Motor_controller_PCBA (1).jpgProject-Motor_controller_PCBA (2).jpghttps://drive.google.com/file/d/11_9oLJAw3wPEA2wkmLM_uxGCVYuwbiEh/view?usp=sharing https://drive.google.com/file/d/1VUQbvXoLrxXxAkR3m1_jeBURiFob2aD8/view?usp=sharing