Skip to content

Latest commit

 

History

History
196 lines (167 loc) · 12.2 KB

0092-2023-06-08.md

File metadata and controls

196 lines (167 loc) · 12.2 KB

8 Jun 2023

Previous journal: Next journal:
0091-2023-06-07.md 0093-2023-06-09.md

MCU/FPGA bridge ideas

  • STM32 emulators:
  • STM32 USB:
  • Maybe Raspberry Pi Pico (RP2040) is the way to go:
    • I have 2 of them already. I ordered them from Element14.com in July 2022, for AU$5.80ea, Specifically I got the standard Raspberry Pi Pico, now closer to AU$6.65.
    • Element14 also stock the Pico W for $11.06.
    • DigiKey stocks the Pico W for $9.36 but I'm having trouble telling if that's inc. or ex. GST.
    • Pico H at DigiKey: AU$7.80
    • They seem to have (or support) a bootloader that allows for drag-drop firmware over USB?
    • When using Arduino framework, Serial defaults to using USB-CDC.
    • NOTE: Unlike STM32, they do not have 5V-tolerant pins. Not necessarily an issue except unless we wanted to connect with PS/2 keyboard/mouse.
    • Can RP2040 be an OTG host for USB keyboard/mouse??
    • Wokwi can simulate, inc. USB-CDC Serial out:
      • Good for development!
      • Not sure if the speed is real, though, because it makes no difference if I set it to 100 or 100,000,000.
  • NOTE: RP2040/Pi-Pico might be a good choice not only for FPGA/silicon debugging, but even actually just as a model driver/game for Raybox.

Notes

  • What are all the different ARM Cortex-M# levels??
  • Look into different machine pin headers inc. male-to-male -- expensive from official suppliers!
  • How well can machine pin FEMALE headers be used like a breadboard, inc. proper mating for passives, dupont wires, and headers?
  • Are there also other types of thin pins or better receptacles? Could even just use a 40-pin ZIF, and that could even be socketed for reuse?
  • When designing DE0-Nano "wing", have an option to run both to an inline butterfly, but also with snap-off breadboard straddles (both DIP-centre-line, and outer edges?)
  • This tall 40-way 0.1″ header pin row could be handy.
  • Lots of other header types.

Raspberry Pi Pico Getting Started (with Arduino libs support)

RP2040 specs (click here to open)
  • 264kB RAM
  • 2MB flash -- actually I think this is not part of the chip, but included on the Pi Pico board:

    No internal flash or EEPROM memory (after reset, the boot-loader loads firmware from either external flash memory or USB bus into internal SRAM) ...so does this mean there is a mask-ROM bootloader that enables external (SPI) flash and/or USB reading??

  • 133MHz 32-bit dual-core ARM Cortex-M0+; overclocking to 400MHz may be possible?
  • QSPI bus controller
  • DMA controller
  • 2 PLLs for USB and core clocks
  • 30 GPIOs, inc. 4 supporting analog inputs
  • 2 UARTs
  • 2 I2C
  • 2 SPI
  • 16 PWM
  • USB 1.1 controller and PHY with host and device support??
  • 8 PIO state machines
  • Debug port
Other notes (click here to open)

Pi Pico Announcement: https://www.raspberrypi.com/news/raspberry-pi-pico-w-your-6-iot-platform/

Ref: https://thepihut.com/blogs/raspberry-pi-tutorials/raspberry-pi-pico-getting-started-guide

Pinout: detail and summary

Misc:

Variants:

  • RP2040 chip has silicon variants (I guess steppings): B0, B1, and maybe B2? Corresponding bootROM versions (see tags).
  • Pico: Standard version without WiFi or pre-soldered headers?
  • Pico W: 802.11n WiFi (WiFi 4 72Mbps+ 2008/2009 standard). MAYBE supports Bluetooth??
  • Pico H: pre-soldered headers.

Hardware needs:

  • Board
  • Micro USB
  • Header pins or similar

Steps

Lots of great info in this circuitstate tutorial inc. use of RP2040 C/C++ SDK in VSCode, and ADF (Arduino Development Framework).

  1. I'm using a standard Raspberry Pi Pico (not W). Silicon revision B1 ("RP2-B1"):

    Raspberry Pi Pico board with B1 stepping

  2. Plug in Pi Pico to Window PC and see what happens...

  3. First USB cord was faulty, so nothing happened. Go figure. Next caused Windows to play USB connection tones and say it was setting up the RP2 device which took about 5~10 seconds. Meanwhile, RPI-RP2 drive appeared:

    H:\>dir /a
    Volume in drive H is RPI-RP2
    Volume Serial Number is 0003-70E2
    
    Directory of H:\
    
    05/09/2008  04:20 PM               241 INDEX.HTM
    05/09/2008  04:20 PM                62 INFO_UF2.TXT
    08/06/2023  08:37 PM    <DIR>          System Volume Information
                2 File(s)            303 bytes
                1 Dir(s)     134,045,696 bytes free
    

    ...127MB device, but that would be fake, for (I guess) streaming data and selectively writing UF2 to flash.

  4. Contents of INFO_UF2.TXT:

    UF2 Bootloader v2.0
    Model: Raspberry Pi RP2
    Board-ID: RPI-RP2
    
  5. INDEX.HTML just redirects to: https://www.raspberrypi.com/documentation/microcontrollers/?version=E0C912952D54

  6. NOTE: No visible activity on the Pico itself, i.e. no LED lit up.

  7. Unplugging and replugging has it come back online immediately now.

  8. NOTE: Plugging in while BOOTSEL button is held has exactly the same effect but probably this is the default mode anyway while no firmware is written to the external flash.

  9. I went here then grabbed the Blink UF2 for Pico. NOTE: Pico W version seems more complicated; maybe it has to go via the WiFi chip, or maybe this version intentionally uses a different LED to make a point? Oh here we go:

    The LED is connected to GP25 on the board’s Raspberry Pi RP2040 for Pico, and WL_GPIO0 on the Infineon 43439 wireless chip for Pico W.

  10. Dragged the UF2 into the RPI-RP2 drive. As soon as it finishes (within a second) it reboots the device, disconnects the USB drive, and starts blinking the LED. Replugging the device goes immediately into Blink now without USB drive connection.

  11. Downloaded Hello World UF2, unplugged Pico, held BOOTSEL, plugged in (to bring up USB drive again), dragged in the UF2, and when it rebooted Windows said it was setting up a new device "Pico".

  12. It seems to have appeared as COM3:

    USB Serial Device (COM3)

    ...USB ID 2e8a:000a.

  13. Connected to COM3 at 9600 baud with PuTTY. Every second it prints "Hello, world!". NOTE: With virtual COM (USB-CDC) I think baud rate is irrelevant. It works the same with baud set to 9600, 115200, or 1234500. The code for this is trivial.

  14. Try USB pass-thru to Linux VM...

  15. Bring up a terminal watching kernel messages: dmesg -dTw

  16. In running Linux VM VirtualBox window, right-click USB status bar icon, and select Raspberry Pi Pico [0100] to tell VirtualBox to hand it over to the VM.

  17. dmesg reveals:

    usb 1-1: new full-speed USB device number 2 using ohci-pci
    usb 1-1: New USB device found, idVendor=2e8a, idProduct=000a, bcdDevice= 1.00
    usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-1: Product: Pico
    usb 1-1: Manufacturer: Raspberry Pi
    usb 1-1: SerialNumber: 000000000000
    cdc_acm 1-1:1.0: ttyACM0: USB ACM device
    usbcore: registered new interface driver cdc_acm
    cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    
  18. Install minicom: sudo apt install minicom

  19. Tried connecting with minicom:

    minicom -b 115200 -o -D /dev/ttyACM0

    ...but it just pauses for 2 seconds and then returns with nothing. Maybe this is because the Pico needs to be reset after the VM hand-over? No errors in kernel log.

  20. Oh wait, I had to run it with sudo, and then it worked (plus, don't need baud?):

    sudo minicom -o -D /dev/ttyACM0

    CTRL-A then X to exit minicom.

  21. I disconnected Pico from the VM and it returned to Windows again as COM3.

Other stuff to try next...