cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WBA55CG ADC DMA CIRCULAR

caglarpasli
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5
Petr DAVID
ST Employee

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.

ahsrabrifat
Senior II

 

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.

caglarpasli
Associate II

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");
}

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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