Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5151

General • Re: BBC BASIC on the Raspberry Pi Pico?

$
0
0
This is one for Bill. The build command I use is 'make BOARD=pico+w' which I assumed would build a version with all the necessary network SYS calls enabled.
I agree that the network support routines seem to be missing from Richard's build. However when I build here they are present. I have opened an Issue on GitHub to discuss.
This issue lead to a discussion between Richard and myself as to how memory is allocated for lwip network buffers.

By default, as built with the pico_cyw43_arch_lwip_threadsafe_background library from the Pico SDK, there is a large static allocation of memory, to be used as a memory pool to supply the network buffers. This memory is unavailable for anything else (including BASIC) if networking is not used.

Richard argued that this is wasteful for a "universal" version of PicoBB, which may be put to many uses, not all requiring network support. He felt that this memory should be allocated out of the space available to BASIC (by lowering HIMEM) when networking was initialised by a BASIC library call, and freed again when network access was terminated.

By replacing the Pico SDK build script for the lwip library (pico-sdk/src/rp2_common/pico_lwip/CMakeLists.txt) with one of my own I have been able implement customised memory allocation routines to achieve this.

It should be noted that the revised code still implements a memory pool that is allocated with a fixed size when networking is initialised. Depending upon network usage, not all of this memory may be actually used for network buffers, or alternately the pool may not be big enough and the program runs out of memory for the network buffers.

The PicoBB repository has been updated with the revised code. I expect that Richard's release will also be updated at some point.

Statistics: Posted by Memotech Bill — Mon Jul 22, 2024 10:55 am



Viewing all articles
Browse latest Browse all 5151

Trending Articles