How to connect x4m03 to my pc?

Discussion in 'X2 & X4 SoC' started by shim, Apr 3, 2017.

  1. shim

    shim New Member

    Hi my name is shim

    I bought a x4m03 module and have trouble with connecting with my pc

    I have sevral question about your module.

    1. I want to use module connector. And I only connect the x4m03 with usb cable.
    ->is it correct? Or Do I need another line like serail port? with JTAG?

    2. If only usb cable is ok, why is this error occur at module connector?? I think it can't call the library...
    (and I already add addpath('../'); addpath('../../include/'); addpath('../../lib/'); in the code)

    The error message is :
    error : loadlibrary (line 447)
    Can't handle the preprocessor , (matlab_wrapper.h)
    c:\users\desktop\moduleconnector-win32-1.1.5\include\matlab_recording_api.h(4) : fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory
    error : test_BasicRadarClassX4 (line 6)
    Lib = ModuleConnector.Library;

    3. How can I connect the x4m03 board with C environment?
    is it possible?

    4. I download the XEPDistanceDemo and try to run the file with atmelstudio
    I can build it but Atmel Studio said : please secect a connected tool and interface and try again
    Do I need some debugger or some kind of program?
    Only thing that I can connect is custom programming tool

    Thank you for read long question

    I hope I can get the reply as fast as you can

    Thank you

    Regards,

    Shim
     
    Last edited: Apr 3, 2017
  2. Ole-Johan

    Ole-Johan Moderator Staff Member

    Hi Shim.

    1. Yes, using Module Connector, USB connection is all you need. You will need the X4M03 to be programmed with the XEP firmware, which it already has from us. But should you reprogram the X4M03 with different FW, you may loose connection.

    2. I asked our engineering team about this, and they have not been able to recreate the problem. They suggest it could be a problem with the Matlab compiler. Could you run "mex -setup" to check?

    3. Have a look at the mcp_wrapper project:
    https://www.xethru.com/community/resources/module-communication-protocol-wrapper.97/

    4. You need a ARM programming device, such as the Atmel ICE:
    http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATATMEL-ICE
     
  3. Hammad Tariq

    Hammad Tariq New Member

    Hey,

    I am trying to connect to the Atmel Studio 7 as mentioned in https://www.xethru.com/community/resources/xep-source.90/

    I can see my ATMEL-ICE connected and it also shows when I select View->ATMEL Tools, however, if I click on Upgrade, it says "Failed to upgrade, try toggling the device on/off and try again", and through the device programming, I am able to go all the way to SWD and Apply but then a dialog appears with "Failed to connect" message, in detail view it says "Failed to setup tool". I am using Windows 10 Pro on an AMD machine and I am searching from last 2 hours but couldn't find any solution as all threads seem to be old.

    Any pointers?
     
  4. Hammad Tariq

    Hammad Tariq New Member

    Ok, got past that. Just had to repair my Atmel Studio installation.
     
    Charlie Shao likes this.
  5. Usman Shahid

    Usman Shahid New Member

    Hi Ole,
    I am trying to connect the X04M03 module with my linux system using C++ APIs for Module connector. I have able to ping the system and initialize the Xa chip using XEP object. I am not able to read a data frame from the device using read_message_data_float API provided in C++ library. Segmentation fault error is encountered the function is used.

    ANY HELP?
     

    Attached Files:

  6. Aksel Johnsby

    Aksel Johnsby Moderator Staff Member

    Hi Usman Shahid
    So the problem is your declaration of data:

    DataFloat *data= NULL;

    Instead declear your DataFloat as such


    XeThru:: DataFloat data;

    and when using read_message_data_float, write

    xep.read_message_data_float(&data);

    Hopes this helps