cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 Interpreting DMA data over serial

gulagman145
Visitor

Hi all,

I am pretty new to ST so bear with me.

The controller is reading in voltage values into the ADC and sending to PC over serial with

CDC_Transmit_FS((uint8_t*), buffer, buffer_length)

I'm getting the data stream, but the values as read in python for instance are b'\x03', b'\x04' with every other value being b'\x03'.

I am trying to figure out how to 'decode' the data for lack of a better word. What format is the data being sent? I'm assuming since it is direct from memory it is bytes (binary)? The code is set up to trigger the transmit function when the ADC conversion is completed, and the parameters I give would indicate the value is in 8-bit bytes for the entire buffer, but I am stymied by the formatting on the receive end.

Some reading indicates that the values shown may either be ascii or something presenting in that way due to how python interprets the data but this has been very difficult for me to figure out since I know next to nothing about direct memory access or ST functionality. When viewing the data in a serial monitor it comes through as a bunch of strange characters different from what I have in python too, not much help there.

Any guidance would be greatly appreciated!

 

 

0 REPLIES 0