Problem with change to STM32F1 board library STM32ADC
Posted: Mon Jun 15, 2020 3:36 pm
Hi! This is not my first, first message. I've been watching but not posting for a while. The forum forgot me and I have just re-registered.
My setup:
The STM32ADC example program 'SingleChannelAtSampleRateCircularBuffer.ino' has served as a model for my ADC-DMA application. The sample program has not been updated (yet) for the STM32F1 board version 2020.6.12. The important code example code, included in the Arduino sketch setup() function, is:
The associated STM32ADC.h code in board versions up to and including 2020.6.7 is:
The STM32ADC.h code for board version 2020.6.12 is:
Where in the (old) example code should the new myADC.startDMA() function call be located? Is right after the mayADC.setDMA() call the best location? How can I find alerts and details about changes like this one to the STM32ADC library? The Arduino Boards Manager 'More Info' links to this forum index page, but that isn't specific about changes in the new board release.
I appreciate your time to consider my questions and hope I can receive some advice here.
Steve
My setup:
- Windows 7,
- Arduino IDE 1.8.12,
- Hardware: STM32F103C8T6 Blue Pill board,
- Upload Method: STM32duino bootloader (USB)
- Installed Boards: STM32F1xx/GD32F1xx boards, version 2020.6.7,
- Installed Boards: Arduino SAMD Boards (32-bits Cortex-M0+), for essential arm compiler tools,
- Selected Board: Generic STM32F103C series, Variant: STM32F103CB (20k RAM 128k Flash)
The STM32ADC example program 'SingleChannelAtSampleRateCircularBuffer.ino' has served as a model for my ADC-DMA application. The sample program has not been updated (yet) for the STM32F1 board version 2020.6.12. The important code example code, included in the Arduino sketch setup() function, is:
Code: Select all
...
Timer3.setPeriod(samplePeriodus);
Timer3.setMasterModeTrGo(TIMER_CR2_MMS_UPDATE);
myADC.calibrate();
myADC.setSampleRate(ADC_SMPR_1_5); // ?
myADC.setPins(&pins, 1);
==> myADC.setDMA(buffer, maxSamples, (DMA_MINC_MODE | DMA_CIRC_MODE | DMA_HALF_TRNS | DMA_TRNS_CMPLT), DmaIRQ);
myADC.setTrigger(ADC_EXT_EV_TIM3_TRGO);
myADC.startConversion();
...
Code: Select all
/* This function is used to setup DMA with the ADC.
It will be independent of the mode used. It will either be used in continuous or scan mode
or even both... go figure.
The reason why this is a uint16 is that I am not ready for dual mode.
*/
==> void setDMA(uint16 * Buf, uint16 BufLen, uint32 dmaFlags, voidFuncPtr func);
Code: Select all
/* This function is used to setup DMA with the ADC.
It will be independent of the mode used. It will either be used in continuous or scan mode
or even both... go figure.
The reason why this is a uint16 is that I am not ready for dual mode.
*/
==> void setDMA(uint16 * Buf, uint32 dmaFlags, voidFuncPtr func);
==> void startDMA(uint16 BufLen);
I appreciate your time to consider my questions and hope I can receive some advice here.
Steve