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

Adds ilabs board and PSRAM support. #2342

Merged
merged 11 commits into from
Aug 24, 2024
Merged

Conversation

PontusO
Copy link
Contributor

@PontusO PontusO commented Aug 20, 2024

Very light testing done but the board comes up and prints over USB now. PSRAM also works, currently only with 8MB and only up to 150MHz CPU clock speed.

@earlephilhower
Copy link
Owner

Now that this is clean in CI, I'll try and pull this and SparkFun into something coherent this weekend. We should be able to take the PSRAM linkage and add a __psram_start symbol that the allocator can use (_psram_end will be calculated per the chip readout). Also would like to compare the clock/timing setup here and there. Looks like SparkFun has compensated for F_CLK and uses the explicit SDK counts vs. hardcoded #s. If they differ, I'll add in a #define in the variant and a #ifndef in the clock routine. The PSRAM setup can also be part of the SDK global runtime inits so it "just works", hopefully. :)

@PontusO
Copy link
Contributor Author

PontusO commented Aug 21, 2024

Now that this is clean in CI, I'll try and pull this and SparkFun into something coherent this weekend. We should be able to take the PSRAM linkage and add a __psram_start symbol that the allocator can use (_psram_end will be calculated per the chip readout). Also would like to compare the clock/timing setup here and there. Looks like SparkFun has compensated for F_CLK and uses the explicit SDK counts vs. hardcoded #s. If they differ, I'll add in a #define in the variant and a #ifndef in the clock routine. The PSRAM setup can also be part of the SDK global runtime inits so it "just works", hopefully. :)

Sounds good. I'll try to help out with getting some of the stuff up that I've been working on for a long time now. I have started to do some more broad testing with running the different examples. So far most things work right out of the box but not everything. Most noticeably Adafruit TinyUSB does not build yet. I'll check in on that tomorrow as it is important to us here.
Got some nice WiFi action going with WiFiEspAT so we're definitely moving in the right direction =)

@earlephilhower
Copy link
Owner

Thanks for the update, especially considering the circumstances. But, isn't PSRAM size calculated at runtime?

....
...
    _psram_size = 1024 * 1024; // 1 MiB
    uint8_t size_id = eid >> 5;
    if (eid == 0x26 || size_id == 2) {
        _psram_size *= 8;
    } else if (size_id == 0) {
        _psram_size *= 2;
    } else if (size_id == 1) {
        _psram_size *= 4;
    }
...

For the linker we can put in a dummy size of 16MB (or whatever is the max possible) which is how we build the SDK with (for flash size)...

@PontusO
Copy link
Contributor Author

PontusO commented Aug 21, 2024

That is very true and this may not be needed at all. What you do get is a link time check that the allocated memory fits in the memory device of the board. I will leave that up to you to decide if it should be in or not 🙂

@PontusO
Copy link
Contributor Author

PontusO commented Aug 22, 2024

Adafruit TinyUSB now build and works but it is not picking up the correct vid/pid.

@earlephilhower earlephilhower merged commit fbaae71 into earlephilhower:split Aug 24, 2024
19 of 20 checks passed
earlephilhower added a commit that referenced this pull request Aug 24, 2024
* Adds iLabs boards and basic PSRAM support.

* Update RP2350Support.cpp

Only build on RP2350 boards

* Update RP2350Support.h

Only on RP2350 boards

* Update PSRAMTest.ino

* Update board_init.cpp

* Update PSRAMTest.ino

* Update RP2350Support.cpp

* Adds a parameter to MakeBoard for PSRAM size and a context sensitive menue

* Adds include path to usb device enumeration if.

* Fixes broken builds.

---------

Co-authored-by: Pontus Oldberg <pontus.oldberg@non.se.com>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
earlephilhower added a commit that referenced this pull request Aug 25, 2024
* Migrate RP2040-specific bits to separate dirs
* Add chip to boards.txt, isolate RP2040-specifics
* Add RP2350 boot2, bearssl, and libraries
* Platform.IO adjust to new paths
* Add RPIPICO2 JSON for P.IO
* Add RP2350 to Platform.io
* Update Picotool and OpenOCD for all hosts
* Use picotool to generate UF2s
* Build separate libpico blobs serially
Thanks for the review, @aarturo182 !
* Add RP2350 to CI
* Allow Ethernet/WiFi building for RP2350
* Update Adafruit TinyUSB to latest
* Test skip fix
* Make RP2350 Picotool work. update USB ID
* Fix EEPROM/FS flash locations
RP2350 adds a 4K header sector to the UF2, meaning we have 4K less total
flash to work with.  Adjust all constants appropriately on the RP2350.
* Adds ilabs board and PSRAM support. (#2342)
* Adds iLabs boards and basic PSRAM support.
* Make PSRAM come up as part of chip init
Uses SparkFun psram.cpp to set timings on clocks which are defined in the
variant file.  Prefix things with RP2350_PSRAM_xxx for sanity.
Users don't need to call anything, PSRAM "just appears".  Still need to
add in malloc-type allocation.
* Add board SparkFun ProMicro RP2350
Same pinout as the SparkFun ProMicro RP2040 with 8MB PSRAM and RP2350
* Add TLSF library for use w/PSRAM
Fork of upstream to include add'l C++ warning fixes.
* Add pmalloc/pcalloc to use PSRAM memory
free() and realloc() all look at the pointer passed in and jump to the
appropriate handler.  Also takes care of stopping IRQs and taking the
malloc mutex to support multicore and FreeRTOS (when that workd)
* Fix BOOTSEL for RP2350
* Add simple rp2040.idleOtherCore test
* Add Generic RP2350 and clean up PSRAM menus
Commercial boards now only have 1 size PSRAM, no need to have menu for them.
* Add Solder Party RP2350 Stamp boards (#2352)
* Add PSRAM heap info helpers, mutex lock mallinfo
* Add RP2350 docs
* FreeRTOS and OTA unsupported warnings for RP2350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants