Hi,
I currently working on ADC measurement possibilities of S32K358, focused on HW triggering.
I have started with SW triggered Adc_example_S32K358, it has been extended (Part4) to make Hw triggered ADC measurements.
Steps done:
In ADC configuration must be an instance (AdcHwUnit) to be configured for DMA operation
In ADC configuration a group (AdcGroup) made for HW conversation.
In AdcHwTrigger container AdcHwTrigger_5 added.
In EMIOS configuration EMIOS_0 instance has been configured:
In Emios Pwm configuration the for CH_5 has been configured for DMA request.
As three Adc channels has been added to the ADC group for Hw triggering three Dma elements needed in ScatterGather element list to be configured.
The Hw triggering software example has the following steps:
Simplified ADC measurement code:
Running of the SW implementation above, the start of Adc_EnableHardwareTrigger(HWGroup) will result the activation of the following assert:
The problem is coming from the first part of DevAssert:
#define ADC_SAR_IP_INST_HAS_CTU(inst) ((Adc_Sar_Ip_au32AdcFeatureBitmap[inst] & (1UL << 2u)) != 0u)
The behevior is based on Adc_Sar_Ip_au32AdcFeatureBitmap configuration values, which are originated in Adc_Sar_Ip_HeaderWrapper_S32K3.h generated file:
where the ADC_SAR_IP_INSTANCE_COUNT value, in our case
#define ADC_SAR_IP_INSTANCE_COUNT ADC_INSTANCE_COUNT
which is from S32K358_ADC.h
#define ADC_INSTANCE_COUNT (3u).
Changing the configuration value in line 151 /* Adc HW Unit 1 */ as it is in line 176 /* Adc HW Unit 1 */ the measurement works.
I don’t know what reason is behind the values defined for feature bitmap, is it acceptable to make the patch described above? Or is there any configuration step to make it work?
Thanks in advance,
Kalman