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.

DLPNIRNANOEVM: Error during develoing new scan mode

Part Number: DLPNIRNANOEVM

Hi,
I'm doing some developing via the source code of the GUI of NIRScan Nano. I'm trying to create a new scan mode via the GUI. Now I'm able to find the new scan mode in the scan configuration dialog.


But when I try to select the new scan mode. It occur the following error.


I tried to debug and work out the reason. I found in the function "static int NNO_GetAck(int isUART = 1)"(in the file "API.cpp") that the variable "pMsg->head.flags.resp" change from 0 to 1 during the codeline "ret_val = USB_Read(InputBuffer);", which may result in the error.


I wish to know why the error happen and how to solve the problem.

Looking forward to your reply.
Thanks in advance!

  • Hi User,

    Welcome to TI E2E forums! Please look into the USB_Read() function definition to understand why the resp bit is being set.

  • Hi Hirak,

    I've tried to look into the USB_read() function, but still can't solve the problem for 2 reasons:

    1. The Usb_read() function operates the struct "InputBuffer" instead of "pMsg", so that I can't follow the variable "resp" when Usb_read is running.

    2. In the Usb_read() function, hid_read_timeout() function is invoked. I find that it may set "resp", but I can't step into hid_read_timeout() while debuging, which makes me difficult to understand why "resp" is being set.

    Thanks & Regard.

  • Hello,

    Please allow us more time and we will get back to you soon.

    Thank you,

    Chris

  • Hi Chris,

    I'd like to provide more information for you.

    1.I've compared two scan configuration:

    (1) Column type, can be selected to do a scan.

    (2) The new type (a copy of column type), can't be select to do a scan.

    I found the only difference between the two scan configuration is "new_u_config.scanCfg.width_px" and "new_u_config.slewScanCfg.section[0].scantype". Is this the reason that the new scan type can't be selected to do a scan? What's more, I found that if the variable "new_u_config.scanCfg.width_px" and "new_u_config.slewScanCfg.section[0].scantype" always keep same(when one varialbe is changed, another will be changed too).

    2. When I'm tried to look into the USB_read() function, I found that the hid_read_timeout() function may cause the failure. But I can't step into the  hid_read_timeout() function, because there are two different difinition in different files.

    I hope the information provided may help you to work out the problem.

    Thanks & Regard.

  • Hi Chris, 

    Please allow us to look at this for some time. Will get back on the first half of next week. Thanks for your patience!

  • Hi Chris, 

    I looked into the problem. Please note the following:

    1. HIDAPI is an opensource library taken from GitHub

    2. The HID_READ_TIMEOUT() definition will depend on the OS the GUI is targeted for. Currently GUI supports only Windows. So you can look into the definition meant for Windows.

    3. It is improbable that HIDAPI will cause error in communication since it has been extensively used in existing GUI communication without any problems. Please relook into your code modification to weed out any errors.

  • Hi Hirak,

    Could you please help me to work out why the error occur? I've doon following modification in order to create a new scan mode:

    1. Create a new scan type in the "dlpspec_scan.h".

    2. Create new files "dlpspec_scan_col_copy.h" and "dlpspec_scan_col_copy.c" to define function and structure for new scan mode.

    3. Add #include files.

    4. Add new item in switch-case (or if-else) and item box in the following files: "dlpspec_scan.c", "dlpspec_helper.c", "scanconfigdialog.cpp", "scantab.cpp" and "spectrum.cpp".

    What's more, when I change the COLUMN_TYPE = 128, COLUMN_TYPE = 0, I can choose column_copy to do a scan, but fail to choose column.

    Do I miss some step when trying to modify the source code?

    Thank & Regard

  • User,

    Can you describe the error your are seeing? Is this a compilation issue or runtime?

    Regards,

    Philippe Dollo

  • Hi Philippe,

    Thanks for your reply!

    I've desribe in the pervious post in this question. It's a runtime issue. I'm able to define and save new scan type in the scanconfig dialog. But when I try to use the new scan mode(SCAN_TYPE = 128) to do a scan, it occured the error: 

    What's more, after I change default scan mode COLUMN_TYPE = 128, the error occurs again when I try to use the COLUM_TYPE to do a scan.

    Do I need t do some modification on the hardware? Or I can create a new scan type just by modifying the source code of the GUi.

    Thank & Regard

  • Hi User, 

    You will need to make corresponding modifications in the NIRScan Nano TIVA source code to support your new scan type. After making the change in TIVA source code you will need to compile the binary and load it on NIRScan Nano Device to get it to work. Currently the TIVA SW is written to support only the default scan configs are supported in the GUI without any GUI code modification.

  • Hi Hirak,

    Thanks for your advice! I'll have a try. By the way, is there a guide about how to compile the binary and load it on the device? So that I can do the job more purposeful.

    Thanks & Regard

  • Hi User,

    Kindly look at NIRScan Nano User Guide Appendix C for a guide to compile the TIVA source code.

  • Hi Hirak,

    Thanks for your reply! I've got the guide about how to compile the source code.

    I still have issue about how to load the source code on the device, could you please give me some advice?

    Thank you in advance!

  • Hi User,

    Please compile the  DLP NIRscan Nano TIVA FW using CCS and a Binary (.bin) file will be generated. Then run the GUI, click on the Utilities Button. On the Utilities screen under Tiva Firmware Update (see attached figure), click the corresponding Browse button to search for the Tiva firmware file (NIRscanNano.bin). Then, click on the corresponding Update button. Wait for the firmware to download. Once the new firmware is downloaded, the NIRscan Nano will reset and reconnect to the PC. This will update both the Tiva firmware and DLP Spectrum Library. Please note that if you are loading your own modified binary, you will need to check the checkbox "Don't Verify Signature" below the TIVA FW Update option on the GUI.

  • Hi Hirak,

    Thank you very much for the detailed answer! Now I can do more developing with the device.

    Thank&Regard

  • Hi User, 

    Glad to know we could help!