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.

OPT3101EVM: Integration and using of Segger J-link debugger

Part Number: OPT3101EVM
Other Parts Discussed in Thread: OPT3101, SEGGER, MSP430F5529

I have installed Code Composer Studio and opened the SDK_OPT3101 project within it. The project compiles without errors. Now, I would like to make modifications
to the source code to control GP3 or GP4 when the distance falls below a certain threshold. I would like to do this using an existing Segger J-link debugger.
Could you please let me know how to integrate this debug tool into CCS? Additionally, I have not yet figured out how to save the configuration data stored in EEPROM
so that I can rewrite it in case of any changes. I would greatly appreciate any support with these questions.

Kind Regards

Thomas

  • Hi Thomas,

    The EVM doesn't have EEPROM but the calibration numbers are stored on the ucontroller. If you want to save these you can add some code to read out the calibration registers and store those values somewhere before loading new firmware into the ucontroller. I haven't linked the EVM with a debugger before but below describes a simpler way that I have been able to debug the EVM firmware.

    An easier way to debug this would be to load the modified firmware onto a MSP430F5529 launchpad and connect the launchpad to the EVM board.

    To do this you will need to connect VDD, GND, SDA, and SCL on J17 of the evm to the launchpad (the firmware will set P4.2 as SCL and P4.1 as SDA on the launchpad).

    You will also need to change the jumper shunt on J19 of the EVM from pins 6 and 7 to pins 5 and 6. You will also need to have the evm plugged into the PC along with the launchpad (for some reason this needs to be done to give part of the EVM board power).

    Let me know if this works for you.

    Thank you,

    Brent Elliott

  • Hello Brent,

    thank you very much for the information. First, I have to get an MSP430F5529 Launchpad and will then let you know if it worked for me.

    Maybe one more question. Does the program stay on the EVM board after debugging and can it then be reconnected and operated with the Latte tool?

    Thank you,
    Thomas Behnke

  • Hi Thomas,

    The firmware on the EVM board will stay the same since you will be pushing firmware to the launchpad's MSP.

    Thank you,

    Brent Elliott

  • Hello Brent,

    I received the launchpad today. Contrary to the description, after connecting the launchpad to the USB, only a Readme file is available in its USB drive. Unfortunately, I am unable to flash any firmware onto it. When attempting to do so, CCS displays the message "TI MSP430 USB1/MSP430: Target must be connected before loading program."

    Thank you,
    Thomas Behnke

  • Hi Thomas,

    The SDK user's guide has a section on loading firmware onto the MSP. Below is a screenshot of this section. You will need to download a small tool to flash.

    Let me know if any issues.

    Thank you,

    Brent Elliott

  • Hi Brent,
    I have started the flashing tool and then tried again to debug or flash the launchpad with Code Composer Studio. In both cases, I received an error message. (See screenshot)


    Thank you,

    Thomas Behnke

  • Hello Brent,

    I have managed to connect and debug the launchpad with OPT3101. (There was a missing setting in the options). Perhaps you can guide me on where in the source code I can access the data for amplitude and phase in order to calculate distance on the embedded side. I then plan to turn on an LED when a certain distance threshold is reached.

    Thank you in advance.

    Thomas

  • Hi Thomas,

    I am not sure which route you took to flash but I typically will build the project (not debug), then use the msp launcher tool to directly flash with the .txt file from the build output. Either way is fine as long as you get it flashed.

    When running the sdk code, the dev.resetInitAndViewData method can be run to continuously capture distance measurements. in this function, liveDataView is called, and from there you can pull the distance in mm from this expression in line 55 of OPT3101device_Functions.cpp:

    (this->data[c1].phase*14989)>>16)

    Thank you,

    Brent Elliott

  • Hi Brent,

    The calculated values in "(this->data[c1].phase*14989)>>16" do not produce stable values. It appears that the filter parameters and/or calibration data are not being used correctly. How can I ensure that the same settings are being used in debug mode as in standalone mode with the EVM board and Latte Tool? Where are the print outputs directed to in the "liveDataView" function? The handling is very frustrating for me! I require more comprehensive support.

    Thank you in advance.

    Thomas

  • Hi Brent,

    How can I read the calibration data from the flash of the EVM board and write it back if necessary? Is there a step-by-step guide available for this?

    Thank you

    Thomas

  • Hi Thomas,

    The calibration data is loaded into the registers of the device after startup in the SDK, so you can place some register reads and print the results out to see the calibration values stored in the device.

    Thank you,

    Brent Elliott

  • Hi Thomas,

    Is there anything else I can help you with on this thread? Otherwise I'll be closing it and if you have further questions we can continue on a new thread.

    Thank you,

    Brent Elliott