Skip to content

Commit 42a0c88

Browse files
authored
Update PIO board definition for PSRAM (#2387)
1 parent 7a9c427 commit 42a0c88

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

tools/json/challenger_2350_bconnect.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"picotool",
5050
"picoprobe",
5151
"pico-debug"
52-
]
52+
],
53+
"psram_length": 8388608
5354
},
5455
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
5556
"vendor": "iLabs"

tools/json/challenger_2350_wifi6_ble5.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"picotool",
5050
"picoprobe",
5151
"pico-debug"
52-
]
52+
],
53+
"psram_length": 8388608
5354
},
5455
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
5556
"vendor": "iLabs"

tools/json/sparkfun_promicrorp2350.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"picotool",
5050
"picoprobe",
5151
"pico-debug"
52-
]
52+
],
53+
"psram_length": 8388608
5354
},
5455
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
5556
"vendor": "SparkFun"

tools/makeboards.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,13 @@ def MakeBoard(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine,
331331
BuildUploadMethodMenu(name, 256)
332332
else:
333333
BuildUploadMethodMenu(name, 512)
334-
MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, boot2, extra, board_url)
334+
MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, psramsize, boot2, extra, board_url)
335335
global pkgjson
336336
thisbrd = {}
337337
thisbrd['name'] = "%s %s" % (vendor_name, product_name)
338338
pkgjson['packages'][0]['platforms'][0]['boards'].append(thisbrd)
339339

340-
def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, boot2, extra, board_url):
340+
def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, psramsize, boot2, extra, board_url):
341341
# TODO FIX: Use the same expanded PID list as in BuildHeader above?
342342
if isinstance(pid, list):
343343
pid = pid[0]
@@ -413,6 +413,9 @@ def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddef
413413
"url": board_url or 'https://www.raspberrypi.org/products/raspberry-pi-pico/',
414414
"vendor": vendor_name,
415415
}
416+
# add nonzero PSRAM sizes of known boards (can still be overwritten in platformio.ini)
417+
if psramsize != 0 and name != "generic_rp2350":
418+
j["upload"]["psram_length"] = psramsize * 1024 * 1024
416419

417420
jsondir = os.path.abspath(os.path.dirname(__file__)) + "/json"
418421
with open(jsondir + "/" + name + ".json", "w", newline='\n') as jout:

tools/platformio-build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
chip = board.get("build.mcu")
2323
upload_protocol = env.subst("$UPLOAD_PROTOCOL") or "picotool"
2424
ram_size = int(board.get("upload.maximum_ram_size"))
25+
psram_len = int(board.get("upload.psram_length", "0"))
2526
if chip == "rp2040":
2627
#ram_size = board.get("upload.maximum_ram_size") # PlatformIO gives 264K here
2728
# but the RAM size we need is without the SCRATCH memory.
@@ -393,6 +394,7 @@ def configure_network_flags(cpp_defines):
393394
"--sub", "__FS_START__", "$FS_START",
394395
"--sub", "__FS_END__", "$FS_END",
395396
"--sub", "__RAM_LENGTH__", "%dk" % (ram_size // 1024),
397+
"--sub", "__PSRAM_LENGTH__", "%d" % (psram_len)
396398
]), "Generating linkerscript $BUILD_DIR/memmap_default.ld")
397399
)
398400

0 commit comments

Comments
 (0)