BP7 REV0 proto run

Let’s assume that these libraries work as they should in the SDK-environment they were developed for.

Then something in the BusPirate environment must throw them off. This could be something like interactions between the different cores that you already found out (and worked around). It could also be some MCU peripheral that is initialized in a different way or different order.

You have some experience running other projects firmware on the BP hardware. Is there some kind of reduced, very barebones set of libraries, drivers and initialization you could use to have as few things that could conflict as possible?

Like not initializing the display, the voltage regulator, the NAND, the LEDs, the PIOs and so on? Just the NOR-flash to boot, the USB and the PSRAM.

2 Likes

For bare bones testing I’m using sparkfuns has_psram example which is nothing but a main.c with an attempt to find the size of the PSRAM.

It has the same issue without any of the bus pirate firmware included. I was really hoping that would be a hint at the issue.

Next I will try the bare bones example on bare metal hardware to see if it persists. It’s not a 1:1 test because pico 2 is rp2350B and lacks gpio47.

Come to think of it, I should make sure my SDK is updated to latest too.

2 Likes

My 7Rev0 didn’t arrive yet, so I can’t do any testing on real hw yet. But I did a bit of bedtime reading of the datasheet regarding the PSRAM.

The code in the Sparkfun driver get_psram_size() function looks quite straightforward and I don’t see anything immediately jumping at me that could cause all this 0xff being written instead of the actual command.

Some ideas that you could look into:

  • DIRECT_TX is a a FIFO with I think 4 words of depth. So if some init-code wrote stuff into it previously but didn’t get to actually pushing it out, this stuff would be written before your new command. Maybe try to repeat writing the id command 4 times to flush the FIFO?
  • always check the TXLEVEL / TXFULL bits to ensure there is enough space in the FIFO before writing
  • look at the SD0 pin with a scope. If there is bus contention, as in the PSRAM or NOR-flash driving it high for some reason, you would see a voltage level quite below 3.3V that could still show up as high on the logic analyzer
  • maybe the security subsystem of the RP2350 interferes somehow. This is a subsystem I haven’t looked into at all yet. But I have seen some access control register for XIP_AUX which seems to affect the direct QSPI access.
1 Like

thats exactly why i am glad to have a original saleae. if i suspect something like that i can quickly switch a analog channel in in addition to the digital ones.

3 Likes

Updated to the latest SDK did not fix the issue.

As best I could, I scoped SD0 with a trigger on PSRAM CS. It did not look like there is contention between chips. However, at this point I have damaged the PCB a bit and attaching things to CS is getting difficult.

I will not test on a PICO2, I forgot the QSPI pins are not broken out and I’m not keen to try to tap them.

2 Likes

contention would apear on the data pins and not the Chipselect though when one chip answers with a 1 and the other with a 0.

And maybe wiring a tiny stub could work for CS hooking

3 Likes

I used PSRAM CS to trigger the scope capture of the SD0 pin.

Turns out the problem is between the chair and keyboard :hot_face:

I connected to SIO2 instead of SI, probably when one of the probe hooks came loose in transport to the soldering station.

Now we can see the correct SPI commands to query chip ID.

Less mysterious now, probably a soldering issue with the PSRAM. I will try to reseat the chip.

3 Likes

Happened to me a few times, too to measure wrong pin. Getting a GND or VCC is more obvious in those cases

Bad connection on a SPI chip is a known issue for me, too. had that once at my computerclub where we debugged a broken BOSE soundbar. final issue was that the MISO pin of the flash had a missing connection ==> firmware load failed and bootfail.

3 Likes

A Spark Fun dev board with this PSRAM is on the way. I’d like to see it actually work with the basic demo, and then try to get the Bus Pirate firmware working on it. Then we know it is a hardware issue pretty much for sure.

While the PCB footprint does extend the pads beyond the body of the device, the chip itself doesn’t actually expose the pads on the sides. Reheating it with an iron probably isn’t doing much. Hot air rework is a last resort because I might not be able to get it back on.

The default KiCad footprint (top) is way off from what other people are using for this chip. That’s probably the issue. The datasheet doesn’t have suggested paste layer, but this from SnapEDA looks more appropriate (bottom).

2 Likes

I’m a big fan of the new quick press to reset, long press to bootload. The press duration to enter the bootloader is about twice what I expect though. A slow count to three.

2 Likes

Fully agree. It was a very welcome feature (while I used it). I look forward to it continuing to be the default. Next up is to model some smaller buttons, and 3D print them, so I can stack my ever-growing collection. :slight_smile:

Looking forward to focusing on this project again soon.

2 Likes

Very good that you found the issue with the wrong command sent.

I got my 7Rev0 today. Have to do some household chores now and will take a proper look at it afterwards.

Can you post the firmware that sends your id command to the PSRAM? Then I could try to run exactly the same fw on mine and see what happens.

3 Likes

bus_pirate7.zip (305.1 KB)

This inits the PSRAM during startup. To see if it worked, type psram on the command line, it should give a size (0 not detected), if detected it runs some memory tests.

3 Likes

thanks:

HiZ> psram
PSRAM setup complete. PSRAM size 0x800000
Failed to allocate memory 1

I’d say this means soldering issue on yours.

All the selftests pass (except the known E9 thing) on my unit, the NAND flash works and the bootloader button also. The SMD soldering looks fine on my unit. Only the SWD header is tilted a bit. But this is the hand soldering of course, totally different thing than the ugly blobs around the RP2350 on henrys unit.

4 Likes

Excellent, thank you so much for the test. Good to know the PSRAM is working.

#if 0
	__psram_size = psram_size;

	uint32_t used_psram_size = &__psram_heap_start__ - &__psram_start__;
	__psram_heap_size = __psram_size - used_psram_size;
#endif

I see why it failed the memory test 1 (some variables not populated in my hacked source).

This is very good news. When the Spark Fun dev board arrives I will debug the memory allocation.

2 Likes

Yes, the footprint seems to be way off, the pads are much too long.

I have used the Winbond NOR flashes in exactly this USON 8 / 3x2mm package that the PSRAM comes in on like 400 units now over several batches, PCBA at JLC. Not one issue with soldering the flash yet. Since I didn’t like the default Kicad footprint I created my own. You can use it if you want.

USON-8-3x2mm_P0.5mm_EPthin.kicad_mod.zip (1.8 KB)

2 Likes

I just hand-measured mine and the bootloader seems to trigger after just a bit over 2 seconds. This is quite shorter than what I’m used to. Yours sounds to take longer.

To me this sounds like there is quite a bit of difference between the units, and maybe temperature. The circuit is optimized for simplicity and not precise timing. It very much depends on the threshold of the FET, and that is something known to vary with each unit and temperature.

The question is if this is ok for this application. I’d say yes.

If not, the two FETs could be replaced by one 74LVC2G14 plus two diodes. Same part as in the VOUT protection circuit. This would give a much better defined threshold, but still be reasonably small (SOT-363).

I just drilled a hole in the case for easy access to the button. I have to say I really like the new case. Much better look & feel than the old one. Also properly sturdy material when drilling.

2 Likes

Im glad you like it, the new case is so much nicer. It was a proper factory instead of a scammer adjacent hack job.

3 Likes

I found an issue on my unit but don’t know if I also got some solder blobs, äh, easter eggs, to search or if it is a firmware issue:

The current limit always triggers if set:

I2C> W
Power supply
Volts (0.80V-5.00V)
x to exit (3.30) > 
Maximum current (0mA-500mA), <enter> for none
x to exit (none) > 
3.30V requested, closest value: 3.30V
Current limit:Disabled

Power supply:Enabled
Vreg output: 3.4V, Vref/Vout pin: 3.3V, Current: 1.2mA

I2C> w
Power supply: Disabled

I2C> W
Power supply
Volts (0.80V-5.00V)
x to exit (3.30) > 
Maximum current (0mA-500mA), <enter> for none
x to exit (none) > 100
3.30V requested, closest value: 3.30V
100.0mA requested, closest value: 100.0mA

Power supply:Enabled

Error: Current over limit, power supply disabled

There is nothing connected to Vout and it doesn’t seem to actually draw excessive current. Injecting a voltage from the outside also works without issue and unreasonable current draw.

So it could also be just the firmware creating the wrong voltage for the comparator or something similar. Or was this the point where you didn’t implement the full I2C DAC stuff because we planned to not continue using them?

2 Likes

I’m not sure I’ve tested the current limit. It should be too high if anything.

However, I believe we removed current detect from.the amux in 7r0 and moved it to a pin, so it could be related to that. I will have a look.

2 Likes