Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • YouTube
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

SG Community Forum

  1. Home
  2. Getting Started
  3. F1 Starter Kit
  4. Communication with external USB device

Communication with external USB device

Scheduled Pinned Locked Moved F1 Starter Kit
5 Posts 3 Posters 515 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sicheo
    wrote on last edited by
    #1

    I need to communicate via USB with an external device. The J102 is user by micropython REPL. Is possible to use J202 with another UART configuration?

    1 Reply Last reply
    1
    • cehlersC Offline
      cehlersC Offline
      cehlers
      wrote on last edited by cehlers
      #2

      Yes, J102 is connected to the USB OTG peripheral of the esp32. I can be used in host or device mode depending on the application requirements. The MicroPython firmware configures it in device mode with serial REPL support.

      Please note that the starter kit cannot be powered via J102.

      Updated in regards to powering connected devices

      F1 introduction video: https://youtu.be/8fsoL0ga_lo

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SicheoSrl
        wrote on last edited by
        #3

        By default, MicroPython firmware configures J202 in device mode with an alternate serial REPL.
        I would like to disable the REPL on the J202 port and use that USB port to talk to a device (probably in udp)
        I tried to disable the REPL using micropython:

        1. I loaded a boot.py file with os.dupterm(None,1)
        2. I loaded main.py script with uart_usb = machine.UART(0, baudrate=115200)
        3. I rebooted the board
        4. I opened a terminal with screen /dev/ttyACM0 115200
          The problem is that when I try to call the:

        uart_usb = machineUART(0,baudrate=115200)

        I get the following error

        Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1).

        Core 1 register dump:

        PC : 0x40376868 PS : 0x00050034 A0 : 0x4212a396 A1 : 0x3fca2790

        A2 : 0x00000208 A3 : 0x3fcf4b80 A4 : 0x40379f50 A5 : 0x3fca2770

        A6 : 0x60000000 A7 : 0x00050021 A8 : 0x82014f05 A9 : 0x403845f2

        A10 : 0x00060123 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000100

        A14 : 0x00060023 A15 : 0x00000001 SAR : 0x0000001d EXCCAUSE: 0x00000006

        EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

        Core 1 was running in ISR context:

        EPC1 : 0x4212aa47 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40376868

        Backtrace: 0x40376865:0x3fca2790 0x4212a393:0x3fcf4b80 0x4201af13:0x3fcf4ba0 0x40385750:0x3fcf4bc0

        Core 0 register dump:

        PC : 0x4212a396 PS : 0x00060e34 A0 : 0x8201af16 A1 : 0x3fcf4420

        A2 : 0x3fca6958 A3 : 0x00060e20 A4 : 0x00060420 A5 : 0x3fcf3930

        A6 : 0x00ffffff A7 : 0x00000003 A8 : 0x82014f05 A9 : 0x3fcf4410

        A10 : 0x00060e23 A11 : 0x00000000 A12 : 0x00060e20 A13 : 0x3fcf4330

        A14 : 0x00060023 A15 : 0x00000003 SAR : 0x0000001d EXCCAUSE: 0x00000006

        EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

        1 Reply Last reply
        1
        • cehlersC Offline
          cehlersC Offline
          cehlers
          wrote on last edited by
          #4

          To modify the functionality of J102, which is the USB OTG peripheral of the esp32s3, you need to modify ext/micropython/ports/esp32/usb.c

          The REPL on UART0 is enabled by default, you cannot just re-assign the UART peripheral, which is why the board crashes.

          If you want to disable the REPL on UART0, you can modify https://github.com/sg-wireless/sg-sdk/blob/40dbabba63db543aeeaa9a313fc00faebd0169cb/src/platforms/F1/sdk-main/micropython/mpconfigboard.h#L7

          F1 introduction video: https://youtu.be/8fsoL0ga_lo

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SicheoSrl
            wrote on last edited by
            #5

            I solved my issue using the UART directly from the Pins P21(TX) and P22(RX). I’ve also deduped UART 1 and use it to communicate with my peripheral.
            To monitor with the REPL I’m using /dev/ttyACM0 (Ubuntu system)

            1 Reply Last reply
            1

            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • YouTube