Pinedio stack is probably the best cheap option, as it has been fully reverse engineered, including the radios- no firmware blobs.
Similar to m5 stack but riscV core.
For an OS you have nuttx, but for the memory size, Oberon ports (A2) might be feasible.
For an OS you have nuttx, but for the memory size, Oberon ports (A2) might be feasible.