Skip to content
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

Add support for lilygo_t_display_rp2040 board #6037

Merged
merged 14 commits into from
May 15, 2023
Merged

Add support for lilygo_t_display_rp2040 board #6037

merged 14 commits into from
May 15, 2023

Conversation

erongd
Copy link

@erongd erongd commented Feb 15, 2022

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! What usb VID and PID did you use? You can get them from Raspberry Pi as well: https://github.com/raspberrypi/usb-pid

@erongd
Copy link
Author

erongd commented Feb 15, 2022

I am not sure how to go about doing that. As I am not the vendor of the board, just got it from internet to use for my own purpose. I used the same VID as the lilygo board with esp32s2 so I assume that is the VID for Lilygo. PID I just made up one for testing purpose, I was hoping the team can help me assign one as the documentation says. Hope this helps.

@jepler
Copy link
Member

jepler commented Feb 16, 2022

If the board maker has a USB PID, we request that they assign a VID for CircuitPython (and for UF2, if applicable).

@erongd
Copy link
Author

erongd commented Feb 17, 2022

I am just a hobbyist playing with boards I acquired myself. I don't know how to go about getting this information from the Chinese manufacturer whom produced them. Any points would help me to get this moving along.

@ladyada
Copy link
Member

ladyada commented Feb 17, 2022

it looks like they have a forum here (found by googling for lilygo) https://community.lilygo.cc/
since you're the customer, you can post there to make requests!

@erongd
Copy link
Author

erongd commented Feb 19, 2022

I will try to give it a go.

@erongd
Copy link
Author

erongd commented Feb 25, 2022

No luck with the community, it is not very active. I am not sure how to move forward from here.

@ladyada
Copy link
Member

ladyada commented Feb 25, 2022

you could request it from raspberry pi on behalf of lilygo - we also recommend emailing a reply to your order, or email some of the addresses
http://www.lilygo.cn/contact.aspx?FId=n7:7:7
we don't own this hardware, and customers can help get manufacturers to support their products

@fabaff
Copy link

fabaff commented Mar 18, 2022

I got a response from Zhang. I guess that's the person's name and mentioned as "Technical email" on their website. #6084 and #6079 also needed PIDs and requesting them on behalf of LilyGo was no problem.

Comment on lines 1 to 2
USB_VID = 0x303A
USB_PID = 0x8008
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record:

A brand new device shows

$ lsusb
[...]
Bus 003 Device 104: ID 2e8a:000a Raspberry Pi PicoArduino

Boot mode

$ lsusb
[...]
Bus 003 Device 103: ID 2e8a:0003 Raspberry Pi RP2 Boot

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to give it a go to request the PID from raspberry.

Copy link

@fabaff fabaff Mar 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted the form mentioned on https://github.com/raspberrypi/usb-pid but not sure if it went through (aka. didn't get a confirmation).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the same, no confirmation though. Let's see. Also in the mean time opened an issue on their official github repo to see if we got any luck.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you suggest I change the value in mpconfigboard.mk to match the lsusb results? I don't think the esp32s2 one is using the factory value though.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use USB_VID = "0x2E8A" (that's the Raspberry Pi foundation) and USB_PID = "0x000B" (that's Circuitpython firmware - according to https://github.com/raspberrypi/usb-pid ). On this page it states in the second sentence after "Use of the IDs" that "In general, the only reason to require one is because Windows uses the product ID to select a vendor-specific driver for a USB device." And from USB's perspective it is just connected to a rp2040, and gets some subfunctions like HID, usbstorage and serial. The pin definitions, possible leds and buttons and displays are all part of the circuitpython firmware, not the USB connection.

Further rationale:
Even the micro:bit just uses VID 0x0D28 (NXP) and PID 0x0204 (Arm Embed) for their connection. Actually, using 0x303A would not be correct, that is the VID for Expressif, but the MCU is not an esp32 but rp2040.

Interestingly, the standard rp2040 board is after the flash identified as VID 0x239A (Adafruit) and not as a Raspberry Pi Pico (0x2E8A) with circuitpython firmware (PID 0x000B)

@fabaff
Copy link

fabaff commented Mar 23, 2022

I'm using the artifact from a7afd66 (adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.

@erongd
Copy link
Author

erongd commented Mar 24, 2022

I'm using the artifact from a7afd66 (adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.

It works just fine on two of the boards I got, so I am not sure what is the problem. Do you have any error you get from serial or it's not booting at all?

@erongd
Copy link
Author

erongd commented Mar 24, 2022

@fabaff BTW, I did not hear back from raspberry foundation at all on the PID request, did you get any response from them for your request? I am thinking to file the request again maybe they have system problems.

@fabaff
Copy link

fabaff commented Mar 24, 2022

Do you have any error you get from serial or it's not booting at all?

Unfortunately no error or other indication about the problem. I guess it's a hardware issue with the display. The unit is working fine otherwise.

did you get any response from them for your request?

No, I didn't

@fabaff
Copy link

fabaff commented Mar 31, 2022

I got an answer from Raspberry Pi Limited regarding the PID. @erongd and LilyGo are CC in my response. In short, it looks like that they would like that the OEM manufacturer is requesting the PID.

@fabaff
Copy link

fabaff commented May 19, 2022

Unfortunatly not much pogress in Xinyuan-LilyGO/LILYGO-T-display-RP2040#5. Still waiting for the PID.

@leeroywking
Copy link

I'm using the artifact from a7afd66 (adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.

Is there anyway to get this build artifact without setting up a local build chain?

@dhalbert
Copy link
Collaborator

Build artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/2032460774. Click on the lilygo "Details" link above, then click on "Summary", and then scroll down.

@tannewt tannewt added the board New board or update to a single board label Jun 22, 2022
@tannewt
Copy link
Member

tannewt commented Nov 15, 2022

As long as you don't work for LilyGo, I'm ok granting pid.codes PIDs for open source code (CP) on closed source hardware. https://pid.codes/

@rcarteraz
Copy link

Build artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/2032460774. Click on the lilygo "Details" link above, then click on "Summary", and then scroll down.

These have expired and are no longer downloadable, is there anyway to get this? It appears LilyGo won't provide a PID, @raspberrypi said LilyGo is the only one that can request it from them but they'd look into it. In the interim, I'm trying some way to flash circuitpython, even if unsupported, to this device. Thanks!

@makermelissa
Copy link
Collaborator

Build artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/2032460774. Click on the lilygo "Details" link above, then click on "Summary", and then scroll down.

These have expired and are no longer downloadable, is there anyway to get this?

Pushing an empty commit should trigger a rebuild.

It appears LilyGo won't provide a PID, @raspberrypi said LilyGo is the only one that can request it from them but they'd look into it.

It sounds like @tannewt is ok with granting PID codes in this case. I'm only looking at this because adafruit/circuitpython-org#913 has been waiting on this for almost a year now.

In the interim, I'm trying some way to flash circuitpython, even if unsupported, to this device. Thanks!

You could try compiling CircuitPython on your system. Perhaps just use an existing pid code just for your system. It doesn't appear to have uploaded anything to Amazon S3.

@dhalbert dhalbert marked this pull request as draft February 17, 2023 16:10
@kreier
Copy link

kreier commented Mar 5, 2023

@erongd @dhalbert @tannewt I would suggest to use USB_VID = "0x2E8A" (that's the Raspberry Pi foundation) and USB_PID = "0x000B" (that's Circuitpython firmware - according to https://github.com/raspberrypi/usb-pid ). On this page it states in the second sentence after "Use of the IDs" that "In general, the only reason to require one is because Windows uses the product ID to select a vendor-specific driver for a USB device." And from USB's perspective it is just connected to a rp2040, and gets some subfunctions like HID, usbstorage and serial. The pin definitions, possible leds and buttons and displays are all part of the circuitpython firmware, not the USB connection.

Further rationale:
Even the micro:bit just uses VID 0x0D28 (NXP) and PID 0x0204 (Arm Embed) for their connection. Actually, using 0x303A would not be correct, that is the VID for Expressif, but the MCU is not an esp32 but rp2040.

Interestingly, the standard rp2040 board is after the flash identified as VID 0x239A (Adafruit) and not as a Raspberry Pi Pico (0x2E8A) with circuitpython firmware (PID 0x000B)

@tannewt
Copy link
Member

tannewt commented Mar 6, 2023

@erongd @dhalbert @tannewt I would suggest to use USB_VID = "0x2E8A" (that's the Raspberry Pi foundation) and USB_PID = "0x000B" (that's Circuitpython firmware - according to https://github.com/raspberrypi/usb-pid ).

This PID is for CircuitPython on the Pico explicitly. This is a different board. Please make a request on pid.codes if you haven't already.

@rcarteraz
Copy link

We're almost there!

@rcarteraz
Copy link

Thanks to @kreier and @tannewt we finally have a PID/VID that can be used for this device. @erongd Are you able to update your PR?

PID: 0x2023
VID: 0x1209

Reference: pidcodes/pidcodes.github.com#827
https://pid.codes/1209/2023/

@erongd
Copy link
Author

erongd commented May 13, 2023

PR has been updated with the assigned VID/PID for CircuitPython.

@erongd
Copy link
Author

erongd commented May 13, 2023

If anyone can let me know the right process to apply for VID/PID or can assign one. I can contribute the board definition for the Lilygo T-Display PICOC3 as well. That is the rp2040 board is the variant with the build-in wifi powered by ESP-C3 chip. The wifi part works with CircuitPython AT library support.

@erongd
Copy link
Author

erongd commented May 13, 2023

I don't know why is the github build failing. It is working fine on my local build. Any points on how to fix it would be appreciated.

@rcarteraz
Copy link

I don't know why is the github build failing. It is working fine on my local build. Any points on how to fix it would be appreciated.

Maybe @dhalbert can offer some insight?

@Neradoc
Copy link

Neradoc commented May 13, 2023

The use of displays has changed since that PR started a million years ago with a change to what the displays array type, see changes here that show how it's done now: d5b747b

And github builds the merged version, so you might need to rebase your local branch on main to build against the same code.

Copy link

@Neradoc Neradoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes I put here should work to make it work and build with main.

ports/raspberrypi/boards/lilygo_t_display_rp2040/board.c Outdated Show resolved Hide resolved
ports/raspberrypi/boards/lilygo_t_display_rp2040/board.c Outdated Show resolved Hide resolved
ports/raspberrypi/boards/lilygo_t_display_rp2040/board.c Outdated Show resolved Hide resolved
@tannewt tannewt marked this pull request as ready for review May 15, 2023 20:03
@tannewt tannewt merged commit 718f9fc into adafruit:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board New board or update to a single board
Projects
None yet
Development

Successfully merging this pull request may close these issues.