Skip to content

Conversation

askuric
Copy link
Member

@askuric askuric commented Mar 19, 2025

  • This PR adds the low-side current sensing for H7 boards.
  • There are some cleanups of the driver code as well, minimal though
  • The current sensing does not work with portenta for the moment - did not have on me at the moment so I could not really test the MBED integration properly.
  • Also I've added portenta and a few other MBED boards to the compile CI

@askuric askuric changed the base branch from master to dev March 19, 2025 10:36
@askuric askuric added the enhancement New feature or request label Mar 24, 2025
@askuric
Copy link
Member Author

askuric commented Apr 29, 2025

H7 low-side is working, I've tested it with the SimpleFOCMini v2.
Before this commit it did not work properly actually. It did not handle the repetition counter missing.

I did find something strange though. In the case where the repetition counter is handled in the software (in the interrupt handler) where we count and use every second measurement, for H7 we have to start from the 2nd call of the interrupt while the other architectures were starting from the 1st call. There is a shift of one interrupt call. I am not sure where does it come from.
I'm wondering if this shift is persistent between the architectures (always the same for the same family) or is it different for different timers, or is there something else going on. In any case I did not see this before.

We need to investigate this!

Here is the code for h7:

if( needs_downsample[adc_index] && tim_downsample[adc_index]++ > 1) {
tim_downsample[adc_index] = 1;
return;
}

And for g4:

if( needs_downsample[adc_index] && tim_downsample[adc_index]++ > 0) {
tim_downsample[adc_index] = 0;
return;
}

@runger1101001
Copy link
Member

How about this one? It still has conflicts...

@askuric
Copy link
Member Author

askuric commented May 14, 2025

Should be all good now!

@runger1101001
Copy link
Member

Lets merge it :-)

@runger1101001 runger1101001 added this to the 2.3.5_Release milestone May 16, 2025
@runger1101001 runger1101001 merged commit 0bb487a into dev May 16, 2025
53 checks passed
@askuric askuric linked an issue Jul 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Copy/paste error in stm32g4 current sense

2 participants