How to increase Main stack size

Do you use the Sparkfun library or the AmbiqSDK?

In the case of Sparkfun, did you rebuild the libmbed-os.a? Look at https://github.com/sparkfun/Arduino_Apollo3/issues/311

Also, look at https://github.com/sparkfun/Arduino_Apollo3/issues/278. The changes in mbed_app.json are NOT included in a static library, so you have to apply them differently / directly in different files.