Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    SPresense SDK on WSL2 ?

    Spresense
    5
    12
    2449
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      KamilTomaszewski DeveloperWorld @jln 0 last edited by

      Hi @jln-0,

      If you have already installed WSL2, now to setup Spresense environment you have to follow instructions for Linux: https://developer.sony.com/develop/spresense/docs/sdk_set_up_en.html#_setup_for_linux

      Best Regards,
      Kamil Tomaszewski

      1 Reply Last reply Reply Quote
      • J
        jln 0 last edited by jln 0

        @KamilTomaszewski , Thank you very much for your reply.

        Using the setup from the Microsoft link on how to access USB devices from WSL2, I encounter a problem. The 'lsusb' command on the Ubuntu distribution that runs on WSL2, the Spresence board indeed appears as :

        Bus 001 Device 003: ID 10c4:ea60 Silicon Labs CP210x UART Bridge

        While the PowerShell "usbipd wsl list" command shows that it binds to COM5 as :

        1-1 10c4:ea60 Silicon Labs CP210x USB to UART Bridge (COM5) Attached - Ubuntu

        But unfortunately, I find no corresponding entry on /dev/ttyS5 on the WSL2 Ubuntu side for me to flash the firmware on the board.

        Or is the board seen through another /dev/tty... ?

        Do you have any suggestion about what I should do ?

        Best regards

        J 1 Reply Last reply Reply Quote
        • J
          jln 0 @jln 0 last edited by jln 0

          It turns out that the USB device is attached to ttyUSB0, but I still can't flash the firmware as the port can't be opened, complaining that the file is not found...

          /spresense/sdk$ lsusb -t

          /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 5000M
          /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M
          |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=cp210x, 12M

          */spresense/sdk$ dmesg | grep "cp21.attached"

          [ 1322.831808] usb 1-1: cp210x converter now attached to ttyUSB0
          [ 1371.440873] usb 1-1: cp210x converter now attached to ttyUSB0
          [10484.027067] usb 1-1: cp210x converter now attached to ttyUSB0

          /spresense/sdk$ tools/flash.sh -c /dev/ttyUSB0 nuttx.spk

          Cannot open port : /dev/ttyUSB0
          could not open port '/dev/ttyUSB0': FileNotFoundError(2, '...', None, 3)

          /spresense/sdk$ ls -l /dev/ttyUSB0
          crw------- 1 root root 188, 0 Jun 24 11:40 /dev/ttyUSB0

          Additional comment : the 'flash' command does not work as sudo either, and I added my user name to the 'dialout' group.

          1 Reply Last reply Reply Quote
          • R
            rauna last edited by

            @jln-0 If you're using Windows WSL2, the port will usually be something like COM7. I use Arduino IDE on Windows to check for my spresense's port.

            J 1 Reply Last reply Reply Quote
            • J
              jln 0 @rauna last edited by

              @rauna Thank you very much for your kind reply.
              The board appears as /dev/ttyUSB0

              G 1 Reply Last reply Reply Quote
              • G
                gyps @jln 0 last edited by

                @jln-0 I'm sure you have already solved this problem, but in wsl2, you can access /dev/tty by using the sudo command.

                $ sudo ./tools/flash.sh -c /dev/ttyUSB0 nuttx.spk
                
                $ sudo screen /dev/ttyUSB0
                
                C 1 Reply Last reply Reply Quote
                • C
                  CamilaSouza DeveloperWorld @gyps last edited by

                  Hello,
                  @gyps, @jln-0
                  Have you been able to successfully flash spresense bootloader using wsl2?

                  @Jolle has experienced the following error, in case you have seen that one before:
                  "Error creating child process!
                  CreateProcessW: Incorrect function."

                  J 1 Reply Last reply Reply Quote
                  • J
                    jln 0 @CamilaSouza last edited by

                    Hi @CamilaSouza Unfortunately, I still get the following error message when trying to flash the firmware using command "sudo ./tools/flash.sh -c /dev/ttyUSB0 nuttx.spk" :

                    Cannot open port : /dev/ttyUSB0
                    could not open port '/dev/ttyUSB0': FileNotFoundError(2,...

                    G 1 Reply Last reply Reply Quote
                    • G
                      gyps @jln 0 last edited by

                      @jln-0 Have you tried the solutions described here?https://forum.developer.sony.com/topic/773/developing-with-spresense-sdk-on-wsl2

                      C J 2 Replies Last reply Reply Quote
                      • C
                        CamilaSouza DeveloperWorld @gyps last edited by

                        Nice catch, @gyps !

                        1 Reply Last reply Reply Quote
                        • J
                          jln 0 @gyps last edited by

                          @gyps Thank you very much, it works !

                          1 Reply Last reply Reply Quote
                          • First post
                            Last post
                          Developer World
                          Copyright © 2021 Sony Group Corporation. All rights reserved.
                          • Contact us
                          • Legal