Did you try to debug? For exact line where the code stops.
- Maybe also try to downgrade MbedOS to version 6.14 or lower because of some changes in SPI.
- For read_ms use this Why is Timer's "read_ms" method deprecated in the upcoming Mbed OS 6? - #7 by hudakz
BR, Jan