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.

How to populate data to structure variable in CCS v6

Hi,

Another query I have to post for following requirement.

- I am using TM4C1294XL board with launchpad and booster package and reading 8 ADC channels from booster pack.and the data read cycle is common for all ADC channels.

- My requirement is I have created a Web page (not from GUI composure) and I am capturing data like Data rate from 'Drop Down', Three variables from text box ,a check box whether to read an ADC channel or not and a 'Submit' button to capture all the data.

- To capture these details I have created a structure in CCS and use them in code.

- Can anyone suggest me how to pass data from webpage on click of 'Submit' and populate this structure and use in CCS?

Thanks,

Bhavesh

  • Bhavesh,

    Would it be acceptable to do this via JTAG? Utilizing the debug probe on the launchpad as your connection you could use JTAG to populate your data structure. This is one of the methods that GUI Composer uses but you could use it in your own webpage.

    There is a package called Debug Server Scripting which is an automation layer that sits on top of the CCS debugger. The default language is JavaScript. You could have your webpage call JavaScript functions that would write your selections to the device.

    Any reason you don't want to use GUI Composer?

    Regards,
    John
  • Hi Bhavesh,

    You can learn how passing of data is done from MCU to webpage and vice versa by learning from one of the Ethernet example programs at Tivaware like enet_io.

    Populating data in a C structure, is the usual, you can see how that is done in C tutorials.

    - kel
  • Hi John ,

    Thank you for replying, But will these work when binary file is installed in release mode?

    My requirement is more like plug and play system. Once you connect board with PC via USB cable some page should pop up on the PC and I can add some fields there and those fields will be used in CCS code.

    Kel,

    I tried with enet_io example but its IP based and requires debugger to be connected to know the IP but in release mode this will be hard to identify.

    Any idea to achieve this via USB? Any link or sample code will be useful.

    The reason to not go with GUI composure because this will not work as plug and play. I have to run installer.exe and also have to install 'guicomposer' in the PC to run the binary. 

    Thanks,

    Bhavesh

  • Bhavesh Patel said:
    I tried with enet_io example but its IP based and requires debugger to be connected to know the IP but in release mode this will be hard to identify.

    There are other Etthernet example at Tivaware, see if those examples can help you.

    Bhavesh Patel said:
    Any idea to achieve this via USB? Any link or sample code will be useful.

    There are also USB example programs at Tivaware, see if those examples can help you. But, I thought you want to access your MCU through Ethernet based from your first post.

    - kel

  • Kel,

    Sorry for not specifying the issue in detail.
    I have thought to use Ethernet for the purpose but hit some ground issues due to DNS and dynamic IP allocation to the board.
    So what I am trying to do is open a kind of console or webpage when device is plugged to PC in which you can insert some variables and same can be sent to board via USB port.
    Currently trying with usd_dev_serial example but do not know how will prompt console or webpage on PC screen.

    Thanks,
    Bhavesh
  • Hi,

    I think what you want to do is similar to USB hot plugging. But, I don't know if that can be done using Tiva MCU's.

    - kel
  • Hi Kel,

    I tried with usb_dev_serial and usb_dev_bulk but not helping to achieve the same.
    Any recommendation to achieve this? Or in another way, how can a board connect to a java or exe application installed on PC?
    Means a board is connected to PC, PC recognizes it and opens an exe or java application and the values can be sent via this application to board.
    Any ideas are welcome.

    Thanks,
    Bhavesh
  • Hi,

    Got success to achieve this via Ethernet. Resolved issues related to dynamic IP and DNS entries.
    Still having some issues when IP is changed by Router. Will open another thread if issue is not resolved.

    As for USB, finding some issues while doing it for Windows 8. Got some success with Ubuntu. But that is postponed for some time so will close this thread.

    Thanks for your recommendations and help to sort out this functionality.

    -Bhavesh