This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMAG5170UEVM: Cannot stop collecting data with TI-SCB through USB BULK channel

Part Number: TMAG5170UEVM
Other Parts Discussed in Thread: TI-SCB

Hi,

I am currently using python script to control the TMAG5170UEVM + TI-SCB setup to collect data.

As suggested in previous thread, I am using USB BULK channel to achieve higher speed (it works). However, once collection starts with 'collect 651 240 0 1', collection will not stop using stop command via serial port (nor other command, e.g. rreg, serial will timeout). Only way is to reset the TI-SCB.

I have also tried to control the board using xshell (collect and stop), after evm_state is collecting, com port will stuck and no response.

Is there anyway to stop collecting once start?

Thank you,

Kit

  • Hello Kit, 

    For the TMAG5170EVM you should be setting the channelAddressIDs setting of the collect command to 1. You should be using 'collect 651 240 1 1' instead to start the collection. 

    As you mentioned, the 'stop' command is the proper way to end the collection. Since the EVM is unresponsive, there is a chance the buffer is filling up faster than you are reading the data out of it. To test this, can you change the collect timerPeriod to a higher value? 

    Best Regards, 

    Justin Beigel

  • Hi Justin,

    For the TMAG5170EVM you should be setting the channelAddressIDs setting of the collect command to 1. You should be using 'collect 651 240 1 1' instead to start the collection.

    Ok well noted, the 0 is when using EVM GUI(from dev.ti.com), I notice the console outputing

    scbCustomCodec.js Received response {"acknowledge":"collect 336 240 0 1"}

    Therefore I changed channelAddressID from 1 to 0.

    there is a chance the buffer is filling up faster than you are reading the data out of it. To test this, can you change the collect timerPeriod to a higher value? 

    Several values (800, 1000 and 1500) tested, seems when below 1000us, EVM will hang and no response. But may I know why it will work in EVM GUI for lower value? I have attached compiled image from GUI (Register map and collect parameter)

    Best,

    Kit

  • Hello, 

    It could be how you are handling the data read from the buffer in your code. If you aren't reading fast enough to keep up with the data being put in the buffer, the buffer will still fill up. 

    Here's how we handle the data in the GUI. We check if the data received matches the number of bytes expected:

    Then we parse it into the desired variables to store in the graphs: 

    Best Regards, 

    Justin Beigel

  • Hi Justin,

    Upon trying, it should be the BULK buffer not being read. After clearing the bulk buffer stop command seems working.

    Thank you and best regards,

    Kit