element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NI LabVIEW Community
  • Products
  • Dev Tools
  • NI LabVIEW Community
  • More
  • Cancel
NI LabVIEW Community
NI Forum Getting error when running with custom firmware on pico with labview
  • Blog
  • LabVIEW Challenge Blogs
  • Forum
  • Documents
  • Quiz
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NI LabVIEW Community to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 33 replies
  • Subscribers 124 subscribers
  • Views 3931 views
  • Users 0 members are here
  • LabVIEW and Test Automation Course
  • pico
  • labview
Related

Getting error when running with custom firmware on pico with labview

cbohra00627
cbohra00627 over 1 year ago

I am trying to create a labview driver for controlling the pi pico led. I went through the Digital Out Control.vi VI in pico_scpi_usbtmc_labtool and tried to replicate it for the led control. I took the blink example from pico-sdk examples directory and added the function to control led (i.e. gpio_put(LED_PIN, 1)) to the SCPI_DigitalOutput() function of gpio_utils.c file in pico_scpi_usbtmc_labtool. I created a new firmware with this change and loaded on pi pico. Now, whenever I do digital write HIGH, the led is turning on.

But when I tried to create a separate driver for led control with a separate SCPI command, I am getting some error while running the VI. The build was successful with my change and I loaded the firmware on the pico, but when I am trying to run my VI (snip attached below), I am getting the below error.

image

Code for led control:

led_utils.c:

image

led_utils.h

image

I have added the led executable and dir path to Cmakelists.txt and also added the INSTRUMENT_LED_OUTP_COMMANDS macro to scpi commands list in scpi-def.c

Am I missing something? Has anyone seen this error before?

  • Sign in to reply
  • Cancel

Top Replies

  • Andrew J
    Andrew J over 1 year ago +4
    This is failing in the init code, so it’s not even reaching your code. One of the installed tools with LabVIEW is NI I/O Trace. Run that, turn on tracing, then run the VI again and see if that gives you…
  • cbohra00627
    cbohra00627 over 1 year ago in reply to Jan Cumps +3
    Its working now!
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to Andrew J +2
    The init block indeed checks for the IDN* string I haven't exposed the connectors to the button that can turn ID Check off. You can do this yourself, by clicking on the connector location in the…
  • Andrew J
    0 Andrew J over 1 year ago

    This is failing in the init code, so it’s not even reaching your code.  One of the installed tools with LabVIEW is NI I/O Trace.  Run that, turn on tracing, then run the VI again and see if that gives you a clue to what is happening.  Also, don’t be afraid of putting a breakpoint on a wire and turning on the lightbulb, then single stepping though the code, probing wires to see values.  Sorry, I’m not at home right now so I’m talking from memory rather than with LabVIEW in front of me.

    I have seen his problem myself: the SCPI ID command would work with NI Visa Interactive Panel but not with my own Visa write.  Turned out that the string command I was sending, “*IDN?\n” was treating the “\n” as two characters and not a control character (new line).  The fix was to right click the string constant and make sure the “display \ codes” option was selected.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to Andrew J

    The init block indeed checks for the IDN* string

    image

    I haven't exposed the connectors to the button that can turn ID Check off.

    You can do this yourself, by clicking on the connector location in the Icon, then selecting the control

    image

    If you write firmware with a different ID string, you should also create a driver and  adapt that Init block to your ID:

    image

    I'll take care that the PST driver is updated to exposes these 2 connecters (set as  optional):

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago

    other warning: that LED is used by the USB code. To provide feedback as prescribed by USB standard.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • cbohra00627
    0 cbohra00627 over 1 year ago

    HI Andrew J Jan Cumps , I checked the string constants inside the init block, the "display \ codes" option is checked. Then I tried turning off the ID query for the init block, this time I didn't face the issue. After running with "Step over subVI", it seems the issue occured after the read operation for ID. In the probe watch window, in the possible reason section, it is written "VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed." One more thing, I am getting this error only on alternate runs and that too only in my custom VI. Other example VI's are working fine.

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Andrew J
    0 Andrew J over 1 year ago in reply to cbohra00627

    If you look at the comment in the code it says to ignore the timeout and the error code is the same as the one in the probe.  I don’t know why this happens really - Jan has given a hint but it’s not something I’ve seen - but that error should get removed and the VI complete successfully.  Is there a value on the bytes read wire.  Also, use NI I/O Trace to get an idea of what is going on.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Andrew J
    0 Andrew J over 1 year ago in reply to cbohra00627

    I had to pop out, but looking a bit further.  Your first error you reported was the other one shown in this VI, 1074003951, which implies that the timeout error is being swallowed (check the output wire of the clean error VI that is highlighted in your image.)  So what is on the wire that goes into the string comparison from the VI Read and the Constant PICO-PI,LABTOOL.  Try probing further through that VI execution but please do try NI I/O Trace to see what it says.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to cbohra00627

    I also can't unfortunately help unless I can see the SCPI commands (which I believe that NI I/O trace will provide).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to cbohra00627

    Do you have a github repo of your firmware?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to cbohra00627
    cbohra00627 said:
    One more thing, I am getting this error only on alternate runs

    When you first run an existing example,

    does your flow then:

    • fail at your first run after that or
    • fail during the second run?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to shabaz

    Yes. We'll not be able to solve this by looking at screenprints.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube