cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5A5 : GPMDA Linked List, what is Datasize

Riscy
Senior
  pNodeConfig.SrcAddress = &(ADC1->DR);
  pNodeConfig.DstAddress = (uint32_t) adc_values_1;
  pNodeConfig.DataSize = 4*64;

In reference to the above based on an excellent tutorial (STM32U5 Workshop) which I use for nucleo STM32U5A5 

https://www.youtube.com/watch?v=_hX6pN2jgYM&list=PLnMKNibPkDnFAy60ZY03q0IK8WztqQKs0&index=8

I struggled to understand what determines the DataSize. How it calculated based on 8 channel ADC12 capture (instead of 4 channels in the tutorial). I looked into the reference manual and it has too many details to narrow down and determine how to set the value correctly.

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
liaifat85
Senior III

The DataSize parameter you mentioned (pNodeConfig.DataSize) is used in Direct Memory Access (DMA) configurations on STM32 microcontrollers. It specifies the size of the data to be transferred by the DMA controller in terms of bytes.

In your case, you mentioned you're dealing with an 8-channel ADC12 capture. If you're reading 8 channels simultaneously, and each channel provides 4 bytes (assuming 32-bit data for each channel), the calculation for DataSize can be done as follows:

Each conversion of a single channel produces a 32-bit (4-byte) result. So for 8 channels captured simultaneously, the total data size for one complete capture would be:

Total data size = 8 channels * 4 bytes/channel = 32 bytes

Therefore, for 8 channels of ADC12 capture (assuming each channel's conversion result is 32 bits), the DataSize would be 32 bytes.

View solution in original post

2 REPLIES 2
liaifat85
Senior III

The DataSize parameter you mentioned (pNodeConfig.DataSize) is used in Direct Memory Access (DMA) configurations on STM32 microcontrollers. It specifies the size of the data to be transferred by the DMA controller in terms of bytes.

In your case, you mentioned you're dealing with an 8-channel ADC12 capture. If you're reading 8 channels simultaneously, and each channel provides 4 bytes (assuming 32-bit data for each channel), the calculation for DataSize can be done as follows:

Each conversion of a single channel produces a 32-bit (4-byte) result. So for 8 channels captured simultaneously, the total data size for one complete capture would be:

Total data size = 8 channels * 4 bytes/channel = 32 bytes

Therefore, for 8 channels of ADC12 capture (assuming each channel's conversion result is 32 bits), the DataSize would be 32 bytes.

Thank it now makes sense. I wondered why this tutorial uses Datasize = 64 x 2 number for 4 ADC12 channels, which should be 4 channels * 4 bytes = 16.