Skip to main content
Associate II
August 13, 2025
Solved

STSPIN issues with current sense

  • August 13, 2025
  • 1 reply
  • 1195 views

We have a design on an ST32G431 based on the B-G431B-ESC eval board that we are trying to migrate to an STSPIN32G4. However the tools appear to not let us set up the same 3-shunt, internal op-amp, internal PGA, differential configuration on STSPIN. There seems to be a problem with the 3rd op-amp and supporting differential mode.

All works fine with the B-G431B-ESC based design but if I create a board based on STSPIN the workbench generates errors.

RCSConnect: ThreeShunt_RawCurrents_Differential_InternalGain Global NO OPAMP for Phase V

We see the same errors if we load the EVLSPIN32G4-ACT board in the workbench and hit "go to summary". The difference with the EVL board is that it has a number of different variants so will still load but doesn't offer the "3-shunt + differential" option even though it is in the board config file.

The pins appear to be available and as far as we understand it the STSPIN is based on the same ST32G431 die so if it works on a ST32G431 it should work on an STSPIN32G4, so is this a tool bug or are the tools protecting us from a silicon problem? We are using Motor control workbench 6.4.0.

Thanks.

Best answer by GMA

Hello @Clive_S,

The limitation is not the current sensing topology, the ThreeShunt_RawCurrents_Differential_InternalGain topology is available on the STM32G4 series.
The limitation is on the OPAMPx input selection, which must be INM0, as on the B-G431B-ESC.

GMA_0-1756371656491.png

On the EVLSPIN32G4-ACT board, the VSHUNT2N signal is connected to the PC5 pin (STSPIN/STM32G4).
The PC5 pin only accesses the OPAMPx_VINM1 input, as specified in the RM0440 document.
The INM0 limitation in the ConnectionParameters.json file is valid.

 

 

1 reply

GMA
Technical Moderator
August 14, 2025

Hello @Clive_S,

For the EVLSPIN32G4-ACT board, the error message originates from an MCSDK internal limitation.
The ConnectionParameters.json file, located in the MC_SDK_x.x.x\Utilities\PC_Software\STMCWB\assets directory, lists the available current sensing topologies. For the STSPIN32G4 MCU, the Differential InternalGain topology is defined as follows:

"ThreeShunt_RawCurrents_Differential_InternalGain": {
    "OpampSignals": [
        [ "CURRENT_SHUNT_?P", "_VINP" ],
        [ "CURRENT_SHUNT_?N", "_VINM0" ]
    ],
This definition indicates that only the VINM0 OpAmp input can be used.

The point will be reported to the dedicated team to identify the root cause of the limitation. However, according to the STSPIN32G4 datasheet, the OpAmp2 VINM1 PA5 input can also be used.

Changing the configuration from [ "CURRENT_SHUNT_?N", "_VINM0" ] to [ "CURRENT_SHUNT_?N", "_VINM" ] allows you to bypass this restriction.
We will provide an update as soon as possible regarding the root cause of this limitation.



If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
Clive_SAuthor
Associate II
August 14, 2025

Thanks @GMA,

That has allowed me to create a board/project and it does appear to have the same configuration I had in the ST32G431 with the opamps in differential mode.

Cheers
Clive

GMA
Technical Moderator
August 25, 2025

Hello @Clive_S,

Unfortunately, the restriction on VINM0 is relevant.
The complete current op amp topologies are described in the STM32G4 Reference manual RM0440.
As mentioned in Figure 175, only VINM0 is available for this topology.
 

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