2025-12-08 1:30 AM
Hello,
We are using a custom board based on EVSPIN32G4 with HSO that has 2 extra ADC channels.
When I try to register them with RCM the entire motor either shuts down or unable to start correctly.
It appears like it interferes with the existing ADC channel operation.
I tried registering it before interrupts are enabled, and after interrupts are enabled. It's all the same.
Here is the code:
static RegConv_t MotorSensorConv = {
.regADC = ADC2,
.channel = TEMP_ADC_CHANNEL_NUM,
.samplingTime = LL_ADC_SAMPLINGTIME_2CYCLES_5,
};
In the init function:
RCM_RegisterRegConv(&MotorSensorConv);In the polling function:
uint16_t value = RCM_GetRegularConv(&MotorSensorConv);
LOG_DBG("Motor sensor adc val: %d", value);
Does anyone know what could be wrong?
Another question, I noticed that callback hooks from mc_app_hooks.c are not called from anywhere?
Anybody knows why?
As another riskier approach I was considering to modify the default ADC configuration to add extra injected channels, but I am afraid to mess up the timings for the existing channels. The idea is that they would be triggered occasionally (every 20 ms max) and just give an interrupt when data is available.
Do you have any feedback on this as well?
Thank you.
Regards,
Mykola
2025-12-08 3:12 AM - edited 2025-12-08 3:13 AM
I feel you have missed Init function check that for ex as below.
RVBS_Init(&BusVoltageSensor_M1);also i have never used the function below, so i am not sure of its impact.
LOG_DBG("Motor sensor adc val: %d", value);The functions in mc_app_hooks.c are used for additional tasks purely based on application requirements, you can add based on your requirements.
2025-12-08 4:56 AM
Hi,
Thank you for your suggestion.
I checked and it looks like our project does not use RVBS at all.
I have also not seen this anywhere in the examples.
Could you explain more why this is needed?
What my project uses is VVBS (Virtual Bus Voltage Sensor).
Regarding the LOG_DBG, it's J Link RTT logging.
I used it before with MCSDK, that's not a problem.
2025-12-08 5:27 AM
@MykolaZaitsev wrote:Hi,
Thank you for your suggestion.
I checked and it looks like our project does not use RVBS at all.
I have also not seen this anywhere in the examples.
Could you explain more why this is needed?
I think you did not understand properly, what i tried to show you is an example if you see any regular conversion manager code as shown below
/*******************************************************/
/* Temperature measurement component initialization */
/*******************************************************/
(void)RCM_RegisterRegConv(&TempRegConv_M1);
NTC_Init(&TempSensor_M1);You have two typedefs
TempRegConv_M1
TempSensor_M1
/**
* temperature sensor parameters Motor 1.
*/
RegConv_t TempRegConv_M1 =
{
.regADC = ADC2,
.channel = MC_ADC_CHANNEL_5,
.samplingTime = M1_TEMP_SAMPLING_TIME,
.data = 0
};
NTC_Handle_t TempSensor_M1 =
{
.bSensorType = REAL_SENSOR,
.hOverTempThreshold = (uint16_t)(OV_TEMPERATURE_THRESHOLD_d),
.hOverTempDeactThreshold = (uint16_t)(OV_TEMPERATURE_THRESHOLD_d - OV_TEMPERATURE_HYSTERESIS_d),
.hSensitivity = (int16_t)(ADC_REFERENCE_VOLTAGE/dV_dT),
.wV0 = (uint16_t)((V0_V * 65536) / ADC_REFERENCE_VOLTAGE),
.hT0 = T0_C,
};What i have observed is you have defined one variable
MotorSensorConvbut i could not find the other variable similar to below which is used in the NTC_Init(&TempSensor_M1); which is missing in your code.
TempSensor_M1I hope it is clear.