On Tue, Jul 30, 2019 at 01:36 AM, Lapo Pieri wrote:
Hi,
02:32 Mon 29 Jul 19 , hugen@... wrote:
You may have pressed the touch screen while adc is initializing.
No, I don't I'm sure
It might be better to add a wait.
I agree. I don't know STM32, I usually develop on NXP LPCxxxx but it seems
to me good.
void adc_init(void)
{
rccEnableADC1(FALSE);
/* Calibration procedure.*/
ADC->CCR = 0;
while (ADC1->CR & ADC_CR_ADEN)
;
ADC1->CR |= ADC_CR_ADCAL;
while (ADC1->CR & ADC_CR_ADCAL)
;
ADC1->CR = ADC_CR_ADEN;
while (!(ADC1->ISR & ADC_ISR_ADRDY))
;
}
Ok, now it works but after a full power-down.
I mean: after re-build and fw load
($ dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build_900/ch.bin)
on subsequent reset it hangs again just after start and stop frequency
printout; switching off and then on rapidly (blue led remains on) it hangs
again. Switching off, waiting for blue led to go down and switching on again
it works. Why?
Many thanks!
Lapo, IK5NAX
Since powering up from DFU mode, aic3204 fails to be initialized at power-on, which will cause I2C abnormality. Re-powering up will make aic3204 normal initialization work normally.