-
Hi
then added a define to my code as follows; "#define PSRAM_CUSTOM_SYSHZ 240000000 // let the peram know the spped of the CPU". Unfortuantly this does not seem to work and things crash. For testing further I just modified a blink sketch as below and set an overclock from the IDE and then set the define to match the frequency. All is ok with an overclock @240MHz, but above that thing seem to fail. Are there other parameter that might need adjusting or am I just doing something stupid ?
|
Beta Was this translation helpful? Give feedback.
Replies: 31 comments 16 replies
-
Just for sanity's sake, make sure you're using |
Beta Was this translation helpful? Give feedback.
-
Many thanks for the quick reply. |
Beta Was this translation helpful? Give feedback.
-
Ah, I think you told me this before (Doh!) , the master is on the root page so cannot be installed from the board manager ? In which case I could download a zip from the root page and select install from zip in the ide ? |
Beta Was this translation helpful? Give feedback.
-
Ah, that is for installing libs and not board packages. Forgive my lack of knowledge!! Do I need to install following the "Install from GIT" instructions ? Will this match where my Arduino installation is ?
|
Beta Was this translation helpful? Give feedback.
-
Ok, so now 300MHZ overclock from IDE works if I set. |
Beta Was this translation helpful? Give feedback.
-
sorry typo |
Beta Was this translation helpful? Give feedback.
-
OK thanks. My oscilloscope is only 50MHz so not much use I am afraid. I do have a fast logic analyzer, but not sure I would be able to get this onto the soldered part. |
Beta Was this translation helpful? Give feedback.
-
My scope isn't fast enough to capture the signalling at these speeds but I can test some things on my board at least. I have a Pimoroni Pico 2 Plus. I do know that my PSRAM runs stable above 88MHz as I have run it up to 109MHz with the core set to 109MHz, and 100MHz at 200MHz core. Going through section 12.14 of the rp2350 datasheet, there are additional timings that are based on system clock, ignoring the divisor. It's likely that these are the key to getting PSRAM (and the onboard flash) operating more stable at higher core speeds, and reduce latency at lower core speeds. |
Beta Was this translation helpful? Give feedback.
-
It would appear that changing QMI_M1_TIMING_RXDELAY_LSB in PSRAM.cpp from 1 to 2 allows me to reach the max valid PSRAM speed at; 327MHz (109MHz PSRAM) and 360MHz (90MHz) were intermittently unstable and required a bump to 3. It seems like MIN_DESELECT and MAX_SELECT are calculated correctly against sysclock, but SELECT_HOLD, COOLDOWN and RXDELAY are all statically set. I am unsure if these other timings need modifications too but it passes the simple PSRAM test sketch. |
Beta Was this translation helpful? Give feedback.
-
@dan2wik
|
Beta Was this translation helpful? Give feedback.
-
@dan2wik |
Beta Was this translation helpful? Give feedback.
-
Ok, I found the clock frequency setting in the lib as (below) at 1.15v, I will try upping to 1.2 as you suggest.
|
Beta Was this translation helpful? Give feedback.
-
@dan2wik |
Beta Was this translation helpful? Give feedback.
-
Ah, spoke too soon, just crashed again!! Will try 1.25V |
Beta Was this translation helpful? Give feedback.
-
So @1.25v still running after 15 mins. Fingers crossed!. Its really sunny out so going to go for a walk and see when I get back. |
Beta Was this translation helpful? Give feedback.
-
Doh!. Run for around two hours and then crashed. Will try without the PSRAM to see if the same! |
Beta Was this translation helpful? Give feedback.
-
The dvhstx library uses some very specific clock settings. I don't fully understand them yet, but from what I can see:
I don't know exactly why 264MHz was selected for the CPU speed, though considering my recent problem with disabled interrupts during SPI transfers I suspect that this is simply how fast the CPU needs to run in order to generate the video data, particularly in the fancy text mode. Would you be amenable to adding a "264MHz (HSTX)" overclock to the menu, if one was contributed? It doesn't feel particularly clean that this one particular library should have to require the core to change just for its clocking requirements, but I don't see any other great ways forward. fwiw while the FruitJam DOES have psram, I have not done a PSRAM-using HSTX project yet so I can't comment on the stability. Without PSRAM in the mix, the overclock has been stable, running text mode and graphics mode demos for 24+ hours at a time. |
Beta Was this translation helpful? Give feedback.
-
On the PSRAM timing setup, I haven't looked at the Arduino Pico implementation at all, but for reference here's my Micropython version: https://github.com/pimoroni/micropython/blob/feature/psram/ports/rp2/rp2_psram.c#L107-L134 I believe that should set timing that works reliably across a wide range of clock speeds (including 264MHz), at least on the Pimoroni Pico Plus 2 😄 |
Beta Was this translation helpful? Give feedback.
-
@MichaelBell |
Beta Was this translation helpful? Give feedback.
-
Still running , so stable at 1.25v with no psram. Will try the mods to psram timings later today! |
Beta Was this translation helpful? Give feedback.
-
Now running HSTX code, 264Mhz, 1.25v and @MichaelBell PSRAM timings. So far so good! |
Beta Was this translation helpful? Give feedback.
-
@dan2wik , yes likely. I will try a Pico plus 2 today i I get a chance!
|
Beta Was this translation helpful? Give feedback.
-
@MichaelBell , will take a look. Thanks |
Beta Was this translation helpful? Give feedback.
-
@earlephilhower |
Beta Was this translation helpful? Give feedback.
-
Sorry that should be Pico Plus 2 and PGA2350 |
Beta Was this translation helpful? Give feedback.
-
Ah, I really should have thought of that (feeling stupid)! Thanks. |
Beta Was this translation helpful? Give feedback.
-
So far tested on PGA2350 with more comprehensive test of PSRAM @MichaelBell I see you have defined " const int max_psram_freq = 133000000;" So the datasheet I downloaded (APS6404L-3SQR QSPI PSRAM) has; "133MHz for 32 Bytes Wrapped Burst operation at VDD=3.0V+/-10%" but "109MHz for 32 Bytes Wrapped Burst operation at VDD=3.3V+/-10%" ? Hacked psram.cpp timing section.
|
Beta Was this translation helpful? Give feedback.
-
@MichaelBell , many thanks fir the explanations (I have some PicoVision). I was matching the hard-coded frequency to whatever was selected on the IDE. |
Beta Was this translation helpful? Give feedback.
-
Although looking at the code again I am thinking I should try setting to sysHz which is passed into the function! |
Beta Was this translation helpful? Give feedback.
-
Feather HSTX 8MB PSRAM |
Beta Was this translation helpful? Give feedback.
May I ask how you're observing the crash, and if you're applying extra core voltage?
My Pico2 is marginally stable at 290MHz and default voltage. I would have to run 1.15v to pass multiple stress tests, and 1.20v to guarantee stability at both your listed frequencies. My project runs 1.25v to reach 360MHz.
Your Feather HSTX is specced with the same PSRAM chip as my Pimoroni Pico2 Plus, just in a different package so other than trace differences, our boards should behave the same.
I have a Pico Probe on the way so if I can replicate your crash, I can debug it when it gets here.