STM32F100 on STM32VL Discovery - Simple ADC voltage measure

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F100 on STM32VL Discovery - Simple ADC voltage meas

Post by Giovanni »

The reason is clear, it is not getting the DMA interrupt that signals that the conversion is complete. The cause is unknown, I need to make a test but this will have to wait the weekend.

Giovanni
bartocham
Posts: 27
Joined: Sun Feb 09, 2014 4:31 pm

Re: STM32F100 on STM32VL Discovery - Simple ADC voltage meas

Post by bartocham »

Ok!
Thank you very much. I would be appreciated if you could help with that. It is really important project for me.
I'll try to do something by myself but I don't think I could do more :(
bartocham
Posts: 27
Joined: Sun Feb 09, 2014 4:31 pm

Re: STM32F100 on STM32VL Discovery - Simple ADC voltage meas

Post by bartocham »

As an addition:

In that moment idle task is marked as current, clock task as sleeping and main as suspended.
bartocham
Posts: 27
Joined: Sun Feb 09, 2014 4:31 pm

Re: STM32F100 on STM32VL Discovery - Simple ADC voltage meas

Post by bartocham »

Again me :)

Mistery solved! Together with my friend which is using ChibiOs with STM32 for almost three years in tons of projects (experience lvl - Asian. If you know what I mean :D ) we found a bug in config.

Previous one:

Code: Select all

static const ADCConversionGroup adcgrpcfg1 = {
  FALSE,
  ADC_GRP1_NUM_CHANNELS,
  NULL,
  NULL,
  0, ADC_CR2_SWSTART,                         /* CR1, CR2 */
  ADC_SMPR1_SMP_AN10(ADC_SAMPLE_1P5),
  0,                            /* SMPR2 */
  ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS),
  0,                            /* SQR2 */
  ADC_SQR3_SQ1_N(ADC_CHANNEL_IN5)
};


New one:

Code: Select all

static adcsample_t samples[ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH];

static const ADCConversionGroup adcgrpcfg1 = {
  FALSE,
  ADC_GRP1_NUM_CHANNELS,
  NULL,
  NULL,
  0, 0,                         /* CR1, CR2 */
  ADC_SMPR1_SMP_AN10(ADC_SAMPLE_1P5),
  0,                            /* SMPR2 */
  ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS),
  0,                            /* SQR2 */
  ADC_SQR3_SQ1_N(ADC_CHANNEL_IN5)
};


For F1 we should not set ADC_CR2_SWSTART. Now everything works.

Thanks for help once again!
Post Reply