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.