AnsweredAssumed Answered

Entering BAM mode in STM32H7

Question asked by Evgeny Erlihman on Nov 7, 2017
Latest reply on Dec 8, 2017 by Evgeny Erlihman

Hello,

 

I want to use the BAM mode, and more specifically, D1/D2 in DSTANDBY, while D3 is in RUN mode. In this mode i want to have ADC3 sampling 3 channels, and transfer the results to RAM using BDMA. I am using LPTIM2 to trigger the ADC3. Using FreeRTOS....

 

I added the following initialization code:

 

__HAL_RCC_LPTIM2_CLKAM_ENABLE();
__HAL_RCC_ADC3_CLKAM_ENABLE();
__HAL_RCC_BDMA_CLKAM_ENABLE();
__HAL_RCC_D3SRAM1_CLKAM_ENABLE();

 

// EXTI_LINE66 is BDMA Ch0 interrupt
HAL_EXTI_D1_EventInputConfig(EXTI_LINE66, EXTI_MODE_IT | EXTI_MODE_EVT, ENABLE);
HAL_PWREx_ConfigD3Domain(PWR_D3_DOMAIN_RUN);

 

And this is how i put the system in BAM:

 

__weak void PreSleepProcessing(uint32_t *ulExpectedIdleTime)
{
/* place for user code */
SCB_CleanDCache();
HAL_PWREx_EnterSTANDBYMode(PWR_D2_DOMAIN);
HAL_PWREx_EnterSTANDBYMode(PWR_D1_DOMAIN);
*ulExpectedIdleTime = 0;
}

 

I do get a couple of conversion complete interrupt from DMA, but than i observe that hdma_adc3 gets nullified. The hdma_adc3 is located at adc.c module, generated by the cube. And accoriding to the map file, it resides in DTCMRAM space.

 

 

Is this the right way to use Batch Acquisition Mode? Am i missing something?

 

Thanks,

EVgeny

Outcomes