Skip to main content
Aurelien1
Associate III
July 17, 2024
Solved

STM32U545 : LPBAM cotinuous ADC multichannel

  • July 17, 2024
  • 5 replies
  • 1456 views

Hi,

I am using an STM32U545 on which I expect to use ADC4_IN1 and ADC4_IN18 in stop mode 2 (using LPBAM).

I want to create two buffer (buff1 and buff2 uint16_t[32]) dedicated to each input.

I want to read 32 samples from input1 then 32 samples from input2 and restart infintely.

I don't find the correct way to configure LPBAM.

In first try, I use an LPTIM1 as trigger I do :

(sorry my project I can't get image of LPBAM configuration)

1) ADC conversion (channel 1) => ADC Conversion (channel 20) and loop on first conf bloc and use LPTIM1 trigger for both

    => In this case each buffer contain values from correct input but i run only once

2) If I do the same but loop on first data bloc => only last channel ise infinitrly sampled on both buffer

Can someone help me to configure it correctly?

Thanks

Have a good day.

 

Aurélien

 

Best answer by OOUAD

Hello @Aurelien1,

 

I suggest porting the project located in STM3CubeFW_U5 from STM32U575 to the STM32U545 :

BRs,

Oussema. 

5 replies

ST Employee
July 19, 2024

Hello @Aurelien1

One way is to use the DMA linked list to link the nodes and enable buffer chaining

=> check this presentation 

 

Aurelien1
Aurelien1Author
Associate III
July 25, 2024

Hi Sarra,

I will be on holiday starting tomorrow. I will try to look into it when I return. Regarding the LPBAM configuration, can you confirm if I need to create 3 queues:

  • One for ADC conversion (channel 1).
  • One for ADC conversion (channel 20 in my case).
  • One for LPDMA.

For both queues, I configure the trigger on LPTIM to set the sampling data rate.

For LPDMA, if I don't set any trigger, will the queue switch between each DMA request at the end of the ADC conversion? Or should I use another timer to handle that switching?

I join a project whivh doesn't work (push button won't wake up device) I will correct this part when I come back.

Does the LPDMA and adc configuration is correct? (for this test I expect to connect debug probe in Hot Plug during the 10s sleep).

THanks for your help

Have a good day.

Aurélien

Billy OWEN
ST Employee
July 19, 2024

Hi @Aurelien1 

 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Billy

Aurelien1
Aurelien1Author
Associate III
August 26, 2024

Hi, do you have more information about channel switching in LPBAM?

To remind, I expect to get 32 samples of one channel before switching to the next one and so on.

Aurelien1
Aurelien1Author
Associate III
September 23, 2024

Is it possible to get an example? I am still unable to do it working...

Thanks for your help

OOUAD
OOUADBest answer
ST Employee
November 5, 2025

Hello @Aurelien1,

 

I suggest porting the project located in STM3CubeFW_U5 from STM32U575 to the STM32U545 :

BRs,

Oussema.