New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino: lack of -DUSB_MANUFACTURER makes manufacturer “Unknown" #631

Closed
nopdotcom opened this Issue Apr 23, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@nopdotcom

nopdotcom commented Apr 23, 2016

PlatformIO Version (platformio --version): PlatformIO, version 2.9.0.dev0

Description of problem

The USB core for Arduino expects a USB manufacturer string as a preprocessor define, -DUSB_MANUFACTURER. See https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/USBCore.cpp#L62 and https://github.com/adafruit/Adafruit_Arduino_Boards/blob/master/hardware/adafruit/avr/boards.txt#L26 for an example of where other packages define it.

Steps to Reproduce

I’m using a MediaTek LinkIt Smart 7688 DUO, but this should happen for anybody using their own VIDs.

  1. Using pio, flash board with USB vendor ID other than Arduino LLC or SparkFun
  2. (In IORegistryExplorer on OS X) “USB Vendor Name” now shows as “Unknown”
  3. Upload a sketch using Arduino IDE
  4. (In IORegistryExplorer on OS X) “USB Vendor Name” now shows as “MediaTek Labs"

Additional info.

I solved this by appending to https://github.com/platformio/platformio/blob/develop/platformio/builder/scripts/frameworks/arduino.py#L126:

    if "usb_manufacturer" in BOARD_BUILDOPTS:
        ARDUINO_USBDEFINES.append('USB_MANUFACTURER=\\"%s\\"' % (env.subst(
            "${BOARD_OPTIONS['build']['usb_manufacturer']}").replace('"', "")))

This allows boards to specify a manufacturer if they care about it.

@ivankravets ivankravets self-assigned this Apr 23, 2016

@ivankravets ivankravets added this to the 2.9.0 milestone Apr 23, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Apr 23, 2016

@nopdotcom

This comment has been minimized.

nopdotcom commented Apr 24, 2016

This works for me.

@ivankravets

This comment has been minimized.

Member

ivankravets commented Apr 24, 2016

@nopdotcom thanks a lot for the report! Would be grateful for a star 🌟 https://github.com/platformio/platformio/stargazers

ivankravets added a commit that referenced this issue Apr 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment