RP2350: Bus Pirate 5XL and 6

5xl6

Raspberry Pi has two new chips out – RP2350A and RP2350B. Some quick stats:

  • 2 x ARM M33 cores at 150MHz
  • 2 x RISCV Hazard 3 cores (up to 2 cores at once, mix and match)
  • 520K RAM (vs 264K on RP2040)
  • 3 PIO modules (vs 2 on RP2040)
  • Hardware floating point unit
  • MUCH improved ADC
  • More pins!
  • A new bootrom that should make it a lot easier to load multiple programs into a single firmware file
  • Some one-time programmable memory to customize the UF2 bootloader drive, among other things
  • A bunch of security stuff

smpssmps-pcb

The on-chip core supply LDO is replaced with a switch mode power supply. It requires a specific expensive inductor that costs more than a TI branded 1.1volt LDO though. The SMPS uses 5 pins on each package so it’s not a drop in replacement for the RP2040.

groundpad

Pin functions and modules like SPI/I2C/PWM are on the same pins as the RP2040, so GPIO0-29 have all the same functions. All ground pins have been eliminated, the only grounding is now through the center pad.

RP2350A

RP2350A has the same 30 GPIOs as the RP2040, but because of the SMPS it has larger 60 pin package. It is not a drop in replacement, but the pinout is similar.

RP2350B

RP2350B has an additional 18 GPIO pins, as well as some extra PWM units on the new pins. It comes in an 80 pin package.

PICO SDK 2.0

One nice update to the SDK is a function to search or a free PIO and SM with enough free space for a program. We’ve talked about rolling this ourselves in the past, but they’ve provided it. Now is probably the time to port over @phdussud 's PIO based frequency measurement.

Bus Pirate 5XL

5XL uses the RP2350A with upgraded RAM and newer ARM cores, but it’s otherwise the same board as 5.

smpsvsldo

We made two versions of 5XL. One used the on-chip SMPS to power the core, and one used a cheap 1.1volt LDO regulator from TI. Rpi was really adamant about the layout for the SMPS, so I worried we wouldn’t get it right or get it through FCC/CE certification. Both boards worked, but in the end the LDO was an easier choice:

  • Half the parts cost of the SMPS
  • Only one additional BOM item (vs 2 with SMPS)
  • Takes less room at a critical place on our existing PCB
  • Presumably less worries about passing certification

adc-improve

The upgraded (or fixed, if you prefer) ADC is a lot better. This is especially noticeable in the current sense measurement which no longer jumps around and is way more accurate.

Bus Pirate 6

Bus Pirate 6 uses the RP2350B with 18 additional IO pins. More pins = more fun.

First, we got rid of the 74HC595 IO expanders. Everything on the board is directly controlled by the RP2350B. Some huge advantages here:

  • Faster. No longer using SPI to change analog mux channels, enable pull-ups and configure the programmable power supply. That also means less traffic on the SPI bus shared with the NAND flash and LCD. The SPI traces are extremely short and tight now, so we might even be able to run at a higher speed (yet to be seen).
  • More space. The Bus Pirate PCB is extremely crowded, we just removed two “huge” TSSOP chips.

labuffer

Second, we finally achieved the long term goal of adding a “follow along” logic analyzer. A 74LVC8T245 buffer connects 8 of the new GPIOs to the 8 Bus Pirate IO pins. Now the Bus Pirate can automatically record what happens on the bus every time a command is sent. Software support is still needed, but I expect this will be a super useful learning and debugging tool.

Previous Bus Pirates can be used as a logic analyzer, but not when active in a mode. When the 1.2-5volt IO buffers are outputs the Bus Pirate can only see its own pin states. The actual bus may have a short or glitches that we can’t see. The 8 pins are a second set of eyes.

bp5-arm-fpga

The first attempt at a Bus Pirate 5 used an FPGA and was capable of having a follow along logic analyzer. After the supply chain crisis hit those parts became unobtainable. When the RP2040 came along, it just didn’t have enough pins to support one. That long term goal is finally realized with the RP2350B.

How it went down

1723117379200

Someone suggested we contact Raspberry Pi about their beta program in mid June. End of June Raspberry Pi read us into the program and sent a handful of chips, some not yet processed into reels.

Over the first few days of July we routed PCBs for 5XL and 6. Two revisions of each – one with LDO and one with the SMPS. About a week later assembled boards arrived to me.

Over a weekend I ported the firmware to the new hardware and the PICO 2.0 SDK. The SDK beta was solid. I had two issues that were due to me not changing the chip type for the B version, so the extra pins didn’t work as expected. There is also a new configuration step for using the PIO with >32 pins that I overlooked. I did find an SDK bug related to the new PWM modules which Rpi quickly fixed.

I also found a silicon bug. When a GPIO pin is configured as an input with its pull-down resistor enabled, it acts like a bus hold. We use the pull-down on the button, which connects to 3.3volts when pressed. During the self-test pressing the button works, but then it never goes low again, it sits at 2.15volts.

I know the dreaded 2.15volts because my logic analyzer has bus hold pins that sit at 2.15volts when connected to the Bus Pirate. It freaks me out every time. Rpi confirmed the issue and added it to the datasheet. Shout out to @henrygab because his cleanup of the self-test made finding this bug instantly possible.

The PCB was revised so the button uses the pull-up and connects to ground, but we also rely heavily on the pull-downs when doing open collector bus types. The pull-down holds the IO pin low behind the buffer, so the PIO can just manipulate the buffer direction without also managing the GPIO direction. Boards will have 100K GPIO pull-downs installed (instead of the usual 1M ohm) until there is a solution.

08.08.2024_12.56.43_REC

08.08.2024_12.57.10_REC

Late July we designed new packaging and had it printed. All three Bus Pirates (5/5XL/6) were accepted into the new “Partner with Pi” program, so you may see their logo around from time to time.

fcc

In the final days of July we passed FCC and CE testing on both boards and geared up production. By a minor miracle hardware is done and at packaging. Orders should start shipping on Monday.

We have a very small quantity of chips, and it’s not clear when we’ll get more.

Conclusion

It was super exciting to see behind the scenes and work with Rpi on launching a new chip. Thank you to them for giving me the opportunity (and the free chips). It was also really exhausting because I had to keep it all a secret. I’m super proud of our whole team for bringing two new boards into production in 6 weeks. Way to go everyone!

8 Likes

Maaannn - I literally just bought a Bus Pirate 5!

(Placed and order for the 6)

3 Likes

If that firmware doesn’t work, let me know and we’ll send a replacement v5 or make other arrangements.

Thank you so much for checking it out. I think the live logic analyzer is going to be killer.

2 Likes

Still getting a solid red led situation unfortunately. If it is easier to return I can just stick it out until I receive the 6 I just ordered. I’m sure the accessories I ordered will work with the 6.

The solid red is expected. Does the com port open though?

We also noticed you got the 2Gbit dev board today, so it may be a solder issue. We only made 5 and there was no way to test them at the time. That may be related.

This is super-exciting … especially the potential to trace the BP’s output lines using the extra pins (“follow along” logic analyzer).

My cleanup of code was helpful?! Awesome, glad to hear it, and thanks for the shout-out. Always feels good to hear investments paying off.

Very exciting times! Time to order some more stuff!

4 Likes

Damn that live logic analyzer stuff sounds epic.

Only just got my BP5 and have hardly played with it yet haha, guess I’m ordering the BP6 now, is it best to order it now or wait? Could there be more physical updates or revisions etc?

1 Like

First look at the datasheet … so much interesting stuff (especially the errata). Just posting a list of things I found interesting, wrapped in a details block to save vertical space in this thread.


2350 Rev A2 First Read

:person_facepalming: (E9), it sounds like this essentially makes the on-chip pull-down resistors unusable. Ouch. I hope they don’t ship many rev A2 chips, and fix this really quickly. Am I too optimistic to have hoped that basic testing of pull-up and pull-down resistors with buttons on all GPIO would be part of their internal testing? This particular errata is … huge.

:heart_eyes: Support for partition tables, even in the UF2 bootloader… this is VERY interesting. Sounds like there are new features specifically enabling multiple firmwares. I’ve got some reading to do…

:eyes: Nota Bene: (E5) seems like it will impact the scope mode, which uses CHAIN_TO and ABORT on the DMA channels.

:mage: (E6) Physical Memory Protection with configurable RWX control. Even for BP5, it is useful to mark the executing image as RX. With eight (8x) programmable regions, this can likely be used to at least crash on some types of memory corruption. (e.g., limit Core1 to only allow execution (X) of Core1 functions + bootrom functions, limit Core2 so it cannot execute Core1 functions, limit write access to stack + BigBuffer_...() memory areas, etc.) Mage icon is used for good reason here…

:heart_eyes: (E2) RP2350 added doorbells! I recall wrapping the Interprocessor synchronization primitives, but transitioning to doorbells might make sense? Something else for me to look at…

:two_hearts: More RAM! This is always welcome. May need to adjust BigBuffer_...() APIs to support more RAM…

:two_hearts: “RP2350 support standard atomic/exclusive access instructions” … reducing the need for spinlocks is always a good thing…

:two_hearts: Two interpolators … interesting bit of hardware, even if used for simple things (e.g., clamping values) instead of their more complex intended uses (e.g., fractional blending).

:mage: Redundancy Coprocess … interesting take on providing hardware-assisted mitigations for ROP and fault-injection. Interesting read, and I expect some cryptography-inclined whitehats to publish papers on some of the well-documented decisions in the next year.

:warning: Hardware TRNG (True Random Number Generator), although … no characterization is done by bootrom, nor does the SDK configure per the recommended characterization procedure. Will this come back to bite them in ten years?

:eyes: Partition tables and UF2 support for custom-defined UF2 families …
and a bunch of complexity for having multiple firmware partitions. A test build firmware can be MAX.MAX.MAX version (to be selected for current boot), and then one can simply erase that partition’s first 4k to revert to the old (known good) firmware. Neat … wish they’d described this example use case more fully.

:two_hearts: RP2350 supports address translation … binaries can be stored at arbitrary flash locations, and execute as if loaded elsewhere (ATRANSn registers). Seems perfectly matched to desire to load multiple images onto the BusPirate, and 5.1.19 describes an example of loading the main application linked to run at a higher address, and then loading a second application linked to run at the default address. Also check out the SDK wrapper for bootrom’s chain_image().

:warning: It is only possible to boot from partitions that are entirely within the first 16MB of flash. Does this imply another stage of bootloader might sometimes be needed?

:mage: Automatic architecture switching … abuse this to have a “safe boot mode” partition, that will load when no ARM image is found?

:eyes: modify the exposed UF2 files to contain custom data: section 5.7

:eyes: PIO blocks have some useful new configuration options and instructions:

  • Ability to more easily synchronize the clock dividers of multiple PIO machines. This was technically possible before, but was tricky.
  • Ability to mask IN-mapped pins (will read as zero)
  • Instruction: Branching, blocking, and clearing SM IRQs

:mage: HSTX peripheral provides ability to output TWO bits per pin, per clock cycle, with hardware support for differential outputs; Alternatively, it can ensure center-aligned clock transitions, but at half that rate (one bit per clock cycle). However, it can only be used with GPIO 12…19.

  • TODO: see if the plank connector is using GPIO 12…19?

Some interesting possibilities are suggested … although time will tell what is actually possible. :slight_smile:

3 Likes

If you expect you’d use it, and can afford to, then order it. Really depends on how much it “costs” you to not have one when you need it, and how much that costs translates to “value” for you.

To me, the BP6 seems “too good to be true”. The increase in onboard RAM and extra PIO block are each a huge win, and are in both of the new chips. Definitely high-value in those improvements.

On the flip side, there are some fairly significant hardware errata at the moment, including (E10) UF2 drag-and-drop totally failing when trying to use partition tables, and (E9) inability to rely on the built-in pull-down for GPIO. Based on the numbering these were only found in the last month or two, and hopefully these will be fixed in next hardware revision (and/or have workarounds soon). Neither is too concerning for BP6 purposes, but … seems like basic tests were skipped … or maybe these early chips should be marked as pre-release versions.

Summarizing: Buy all of Ian’s stock! :wink:

4 Likes

I found E9 a couple weeks ago, thanks to your self test updates :slight_smile: had to do a PCB revision and do FCC and CE testing again.

2 Likes

Bus Pirate 5XL & Bus Pirate 6 testing update:

We had really awful yield on the first batch. We ran 25 panels (100 pieces) of each. 30% of BP6 and 20% of BP5XL failed factory testing. It was like the corner case with the RP2040 with the XOSC* startup delay issue: LEDs and LCD ok, but USB doesn’t connect.

However, when they arrived at the office we tested them again and all passed. There was some weirdness with the factory testing computer and the terminal COM port was swapping randomly with the binary COM port.

* So I learned that Rpi specifies a very specific crystal for the RP chips. I did not know this until the beta program. Bus Pirate 5 uses a cheap crystal from a reliable manufacturer. Evidently it should be an abracon part that is pretty much only used by RP chips. 5XL and 6 use the specified part, which is 10x more expensive :slight_smile:

It depends on how eager you are :slight_smile: There very well could be updates, we pulled it together in 6 weeks so :man_shrugging: On the other hand, the tough stuff is the analog bits and that is the same a 5.

I have no idea what the chip supply is going to be like going forward, I don’t even know the cost at this point. I have a small reel of each chip given to us by Rpi and that will be the end of it for now.

It does come with our usual “we’ll do our best to look after everyone” guarantee. If serious issues arise and you can’t do the board surgery yourself, we’ll send a replacement when/if available.

3 Likes

There hasn’t been a chance to do a proper change log, but here’s an overview of the hardware updates to Bus Pirate 6:

1.1volt LDO

As the comment makes clear, this was a rush job :slight_smile: The Texas Instrument 1.1volt regulator supplies the Rp2350 core. It’s about 0.3RMB, while using the SMPS is ~1RMB. The LDO takes less room and is less fiddly.

image

Still need to power VREG_AVDD and VREG_VIN. It works without VIN powered because an early datasheet didn’t mention it so I didn’t connect on the first board version. When reviewing the board Rpi said to connect it.

74HC595-ectomy

image

The IO expanders are gone. Opens up board space, relieves pressure on the internal SPI bus shared with the LCD and NAND flash, etc. Great update.

image

We still need a level translator for the various 5volt signals on the board (amux select, pull-up enable, LED data). The 74HCT245 is changed to DFN package, which is about 10x more expensive than the TSSOP version. Only Nexperia and TI parts are available, no Chinese domestic manufacturers currently make this chip in DFN. WuXi I-Core may start selling one soon.

74LVC8T245

image

This 8bit buffer runs at 3.3volts on the Bus Pirate side, and from VOUT_VREF on the other. It is fully qualified for partial power down operation. It’s pretty fast too.

image

Another DFN part. These are super expensive in cut tape. Initially it was a Nexperia part, but Wuxi I-Core just started making their equivalent in DFN and it’s about half the price. TSSOP version is probably ~0.65RMB, but the DFN is 4-8RMB.

image

The buffer connects to the outermost point of the buffered IO pins, and to GPIO20-27 on the RP2350B.

Over current detect

image

This was read through the analog mux with the ADC due to lack of pins. Now it has a dedicated pin, but currently the firmware still reads through the mux.

Series Resistor

Forgot this one: Decreased series IO resistor from 330ohms to 120ohms. If that doesn’t give us any issues, I’ll decrease it to 70ish ohms in a future revision.

Free pin

image
Yup. One spare pin.

PCB

image

The analog area and the RP2350 area of the board were reworked quite a bit. The internal layers are mostly ground. In the future I’d like to rework the front end. The resistors by the 10P connector are a nightmare in production (hand soldering the header constantly causes shorts that have to be fixed). I’d also like to add additional protection diodes and TVS diodes on each pin. It’s really tight in there so that may be more aspirational.

2 Likes

It seems like RPi has a shady deal with a crystal supplier, so they say that they are compatible only with a unique and expansive part.
The fact that the BP5 works well with an aftermarket part further indicates that RPi claims are bullshit.

Have you tried using a different crystal?

By the way, I have ordered both BP 5XL and BP6, can’t wait to test them out

Thanks for checking out the new Bus Pirates :slight_smile:

The impression I get is that the chip is a bit sensitive and they have limited resources to qualify a bunch of parts. So, they go with something that will absolutely work.They also offered to send a reel of crystals with the chips.

We bought the crystals from our normal parts “scalper” (selling cut tape), and they said “oh are you changing the crystal on your Raspberry Pi board?”. Evidently that’s the only thing using these crystals, they call them “Raspberry Pi crystals”.

XOSC must use the Abracon ABM8-272-T3 crystal* (the 50R ESR max as well as load cap are critical parameters)
XOSC must use the 1K damping resistor as per Pico 2

It seems to be tuned to this crystal, maybe there will be a revision update with a easier to satisfy oscillator circuit. Maybe it’s time to ditch the crystal and use a 3.3volt oscillator :slight_smile:

The inductor is a similar situation. When we made a version with the SMPS core supply we used the specced DFE252012F-3R3M=P2 inductor, with 10uF capacitors. The current recommendation is a polarized inductor without a part number and 4.7uF caps. They seem to be doing their best to have a reliable first impression, and worry about giving us dirty cheap substitutes later :rofl:

3 Likes

There is a new VSCODE extension for RP and PICO SDK.

One of the big changes in the sdk: the old uf2 utility is replaced with picotool. I compiled from source on Ubuntu (well, WSL), but couldn’t get it under windows. I guess this extension takes care of that.

I’ve merged the rp2350 firmware with main branch, now attempting to compile with the new SDK.

2 Likes

The RP2350 branch of the repo is updated to main. I did some tweaks to get both rp2040 and rp2350 to compile against SDK2.0. It is absolutely required to clean & reconfigure after changing chips/platforms.

The VScode extension did install the toolchain and the SDK, but the import project failed so I can’t use it to actually configure the project.

Next, the build server needs to be updated. This is going to be tricky.

bus_pirate5_rev10-sdk2.0.zip (187.7 KB)

Firmware for 5 REV10 using new SDK.

1 Like

At least a temporary fix for cmake:

Added cmake configuration flag “BP_PICO_PLATFORM”. If set to “rp2350” then build rp2350, else build rp2040.

To add the flag in VScode:

  • You need to have cmake extension installed
  • CTRL+SHIFT+P
  • Type “open settings”
  • Filter for cmake settings
  • Add flad “-DBP_PICO_PLATFORM”

That should do it. Be certain to clean & reconfigure after changing platforms.

This should be enough to get the build server going tomorrow.

I’m reviewing and making a PR for some Quality-of-Life style changes.

For the CMakefiles.txt … conceptually, is it possible to have a CMakefiles.txt that just enumerates multiple other CMakefiles.txt in subdirectories, which each are distinct projects?

As an example (conceptually … I’m no expert with CMakefiles.txt):

  • /CMakefiles.txt … just references two projects in subdirectories, one for RP2040 and one for RP2350.
  • /CMakefiles.common.txt … contains the common bits
  • /RP2040/CMakefiles.txt … sets the platform, but mostly includes from common file in root, and defines targets for BP5 Rev8, Rev9, Rev10
  • RP2350/CMakefiles.txt … sets the platform, but mostly includes from common file in root, and defines targets for BP5XL and BP6

This really feels like something CMakefile should support. Perhaps the folks from RPi can give recommendations on how to enable a project to build targets for both RP2040 and RP2350 using CMakefile.txt … as it’s likely going to be requested by more than one party/project…

1 Like

Good suggestions. I’m learning cmake on an ad-hoc basis, so I really don’t know. I’ve seen stuff in the SDK structured the way you describe though.

In case others hit this:

When I added the above parameter for rp2350, and reloaded VSCode, it simply error’d out with the following message:

[cmake] CMake Error at cmake/pico_sdk_import.cmake:74 (message):
[cmake]   Directory '/home/henrygab/.pico-sdk/sdk/2.0.0' not found
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:48 (include)

Thus, at least for now, you may need to install the v2.0 Pico SDK manually, and have it in the expected directory (as per the error message).

Continuing to work on getting a working build environment for the new boards…