This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Data acquisition from STM32f407 to MATLAB

I am getting data from a current sensor through the adc of stm32f407. I want to export that data to MATLAB at real time or at least at sampling frequency of 10 kHz. I tried STM TrueStudio but its sampling rate is only 1 kHz. So please let me know what should I do to get data?

Parents
  • Hi Zahid,

    You dont mention the mechanism that STM Studio is using to access the data (sorry I am not familiar with STM Studio) and you dont mention the board you are using and its trace capability.

    In general the options available to you are:

    1. Configuring the DWT unit to monitor reads of the ADC and getting this sent out via trace (TPIU or SWO)
    2. Instrumenting the code to write the ADC values out via ITM and getting this sent out via trace (TPIU or SWO)
    3. Instrumenting the code to write the ADC values out via a UART
    4. Instrumenting the code to write the ADC values into an internal RAM store and then block off loading the data (some debug tools can do this automatically)

    The rate at which you can offload the data depends on the board and SoC package you are using. If you only have SWO (SWV) available then the offload rate will depend in its clock frequency. If you have a 4 bit TPIU port you would get much higher bandwidth - but then need a debug adapter that supports TPIU trace capture (like ULINKpro or DSTREAM).

    Hope this helps - or at least gives you options to think about.

    Regards Tony

Reply
  • Hi Zahid,

    You dont mention the mechanism that STM Studio is using to access the data (sorry I am not familiar with STM Studio) and you dont mention the board you are using and its trace capability.

    In general the options available to you are:

    1. Configuring the DWT unit to monitor reads of the ADC and getting this sent out via trace (TPIU or SWO)
    2. Instrumenting the code to write the ADC values out via ITM and getting this sent out via trace (TPIU or SWO)
    3. Instrumenting the code to write the ADC values out via a UART
    4. Instrumenting the code to write the ADC values into an internal RAM store and then block off loading the data (some debug tools can do this automatically)

    The rate at which you can offload the data depends on the board and SoC package you are using. If you only have SWO (SWV) available then the offload rate will depend in its clock frequency. If you have a 4 bit TPIU port you would get much higher bandwidth - but then need a debug adapter that supports TPIU trace capture (like ULINKpro or DSTREAM).

    Hope this helps - or at least gives you options to think about.

    Regards Tony

Children