Skip to main content
Associate II
May 8, 2025
Solved

STM32WBA55CG ADC DMA CIRCULAR

  • May 8, 2025
  • 3 replies
  • 545 views

hello,

I want to set up a timer2 TGO triggered DMA system with 60 samples in 20ms from 4 channels.

I made the linked_lisit settings etc. via CubeMx but I can't get a sample from the ADC.

Can you help me?

Best answer by caglarpasli

Hi, 
I set it as normal instead of linked list and selected it as circular. After that it was fixed.
Best Regards.

3 replies

Petr DAVID
ST Employee
May 9, 2025

Hi there,
there is an example for STM32WBA55CG -  ADC_SingleConversion_TriggerTimer_DMA in the STM32CubeWBA SDK. Have you checked it out already? It is using TIM2 for triggering the conversion and it should be rather easy to edit the example with adding the ADC channels and changing period measurements. Let me know if you will in a need of further assistance.

Kind regards.

Senior III
May 9, 2025

 

You must manually start ADC and timer if CubeMX doesn’t auto-generate:

HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buffer, 60); // 60 samples total
HAL_TIM_Base_Start(&htim2);

If you're using linked list DMA (BDMA or GPDMA), the HAL_ADC_Start_DMA() won't be enough—you must use HAL_ADCEx_... functions or LL drivers.

Associate II
May 9, 2025

Problem is solved. Thanks. 

I have another problem. 

I am designing 2 devices, 1 client and 1 server. The uuid of the server device is always 16 bit. I am discovering the service on the client side. Although the connection handle start and end handler are correct, the result always returns unsuccessful.

result = aci_gatt_disc_all_char_of_service(
a_ClientContext[index].connHdl,
a_ClientContext[index].ALLServiceStartHdl,
a_ClientContext[index].ALLServiceEndHdl);

if (result == BLE_STATUS_SUCCESS)
{
gatt_cmd_resp_wait();
LOG_INFO_APP("All characteristics discovered Successfully\n\n");
}

STTwo-32
Technical Moderator
May 10, 2025

Hello @caglarpasli 

Happy that you have been able to solve your issue. Could you please put the solution here and mark it as best answer. After that, open a new case with more details for your new question.

Best Regards.

STTwo-32

caglarpasliAuthorBest answer
Associate II
May 15, 2025

Hi, 
I set it as normal instead of linked list and selected it as circular. After that it was fixed.
Best Regards.