USB communication problems

Posted on
  • I have one Pico which has severe problems with the USB serial interface. Data always gets corrupted both ways. With another Pico, that doesn't happen.

    The Pico itself seems to work fine, but it's almost impossible to work with it over USB. Transfering a program with the Web IDE (at 9600 baud) corrupts data in 9 of 10 cases and then the program kind of runs but crashes in different places due to syntax errors, undefined functions and properties etc. When I enable "Throttle send" in the Web IDE, uploading a 100 lines of code takes 15 to 20 seconds but it works most of the time. But then again, subsequent communication through the console gets corrupted in both directions. I'm posting some examples below.

    I had originally set up my waveform flash streaming stuff on a breadboard and then decided to put all the components onto a PCB. I took a new Pico for that and left the old one on the breadboard so I could trace the wires which I needed to solder onto the PCB. Unfortunately I didn't test that Pico before, since I did not expect such problems. Since I didn't have enough stackable pinheaders, I soldered the Pico onto the PCB, so now I cannot easily replace it with another one.

    What should I do?

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v79 Copyright 2015 G.Williams
    >ules.removeAllCached();
    =undefined
    Uncaught Error: Field or method "removeAllCached" does not already exist, and can't create it on undefined
     at line 1 col 5
    ules.removeAllCached();
         ^
    
    _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v79 Copyright 2015 G.Williams
    >echo(0);
    Uncaught Error: Field or method "finish" does not already exist, and can't create it on undefined
     at line 3 col 67
    ...is.spi.write(data)};ototype.finish=fu­nction(){digitalWrite(t...
                                   ^
    
    in function called from system
    Uncaught SyntaxError: Got ':' expected ')'
     at line 1 col 325
    ...t(a[2].substr(d-2))/60)*(-1:1),lon:(p­arseInt(a[4].substr(0,e...
                                   ^
    
    Uncaught Error: Field or method "seek" does not already exist, and can't create it on undefined
     at line 16 col 8
      flash.seek(0, 0);
      @4Î /aÎ ñÿÿÿline 1 col 6
    play();
          ^
    
    > play()
    =undefined
    > dump()
    […]
    function playÎ 4Î tÎ ñÿÿtion(b) {
        b.set(audioCache);
    
    {
      "time": "14:2ì| Î ì|d{ \9 Ð| ñÿÿÿPÏ  "satellites": 0, "altitude": NaN }
    {
      "time": "14:26:54",
      "lat": NaN, "lon": NaN, "fix": 0, "satellites": 0, "altitude"Î \{
      "time": "14:26:55",
      "lat": NaN, "lon": NaN, "fix": 0, "satellites": 0, "altitude": NaN }
    
  • And it's only one Pico that has that problem? Are they running same firmware version?

  • It's only one Pico. Two other Picos with the same firmware 1.79 work like a charm (albeit on breadboards).

  • Wow, that's strange. And you're uploading the exact same code to the others that are working fine? I find it really odd that one is having problems and the others aren't.

    Could you try installing the firmware from here? It's the new (beta) USB HID firmware and it's got totally re-written USB - it may help to solve your problems.

    Also, can you take a quick look at the resonator (tiny metal box right at the end of the board) and check that it looks ok? That's about the only hardware-related thing that I can imagine could cause a difference.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

USB communication problems

Posted by Avatar for Dennis @Dennis

Actions