STM32G0xx
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: STM32G0xx
Hi,
G0 examples are in the "multi" projects, no standalone projects for newer platforms (going to remove gradually old ones too).
Giovanni
G0 examples are in the "multi" projects, no standalone projects for newer platforms (going to remove gradually old ones too).
Giovanni
Re: STM32G0xx
trying to use ADCD1 on G071 device and getting this compile error, i'm using the example from the multi projects
adc.c:38:1: warning: missing initializer for field 'tr3' of 'ADCConversionGroup' {aka 'const struct hal_adc_configuration_group'} [-Wmissing-field-initializers]
38 | };
| ^
In file included from ../chibiOS/os/hal/include/hal_adc.h:101,
from ../chibiOS/os/hal/include/hal.h:300,
from adc.c:9:
../chibiOS/os/hal/ports/STM32/LLD/ADCv5/hal_adc_lld.h:351:29: note: 'tr3' declared here
351 | uint32_t tr3; \
| ^~~
../chibiOS/os/hal/include/hal_adc.h:146:3: note: in expansion of macro 'adc_lld_configuration_group_fields'
146 | adc_lld_configuration_group_fields;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adc.c:38:1: warning: missing initializer for field 'tr3' of 'ADCConversionGroup' {aka 'const struct hal_adc_configuration_group'} [-Wmissing-field-initializers]
38 | };
| ^
In file included from ../chibiOS/os/hal/include/hal_adc.h:101,
from ../chibiOS/os/hal/include/hal.h:300,
from adc.c:9:
../chibiOS/os/hal/ports/STM32/LLD/ADCv5/hal_adc_lld.h:351:29: note: 'tr3' declared here
351 | uint32_t tr3; \
| ^~~
../chibiOS/os/hal/include/hal_adc.h:146:3: note: in expansion of macro 'adc_lld_configuration_group_fields'
146 | adc_lld_configuration_group_fields;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: STM32G0xx
Do have another question
Using a in a gptimer callback can you start the ADC conversion ?
i.e.
static void gpt3Callback( GPTDriver *gptp )
{
adcConvert(&ADCD1, &portab_adcgrpcfg1, samples, ADC_GRP_BUF_DEPTH);
cacheBufferInvalidate(samples, sizeof (samples) / sizeof (adcsample_t));
}
Using a in a gptimer callback can you start the ADC conversion ?
i.e.
static void gpt3Callback( GPTDriver *gptp )
{
adcConvert(&ADCD1, &portab_adcgrpcfg1, samples, ADC_GRP_BUF_DEPTH);
cacheBufferInvalidate(samples, sizeof (samples) / sizeof (adcsample_t));
}
Re: STM32G0xx
Tabulous wrote:Do have another question
Using a in a gptimer callback can you start the ADC conversion ?
i.e.
static void gpt3Callback( GPTDriver *gptp )
{
adcConvert(&ADCD1, &portab_adcgrpcfg1, samples, ADC_GRP_BUF_DEPTH);
cacheBufferInvalidate(samples, sizeof (samples) / sizeof (adcsample_t));
}
sorted it with
adcStartConversion and adcStartConversionI
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: STM32G0xx
Hi,
Correct, use adcStartConversionI() from callbacks and don't forget to enclose it in the proper lock/unlock (from ISR) functions.
When doing this kind of things make sure to enable the state checker in chconf.h, it catches all this kind of problems easily.
Giovanni
Correct, use adcStartConversionI() from callbacks and don't forget to enclose it in the proper lock/unlock (from ISR) functions.
When doing this kind of things make sure to enable the state checker in chconf.h, it catches all this kind of problems easily.
Giovanni
Who is online
Users browsing this forum: No registered users and 20 guests