As per discussion:
https://github.com/orgs/micropython/discussions/12573
rshell appears to hang after 5-20 loops of the following program:
from time import sleep
from machine import lightsleep
while True:
print ('waiting 2 seconds for a CTRL-C')
sleep(2)
print ('going to lightsleep for 2 seconds')
sleep(0.1)
lightsleep(2000)
print ('woke-up again')
sleep(0.1)
lightsleep messing with the USB has been suggested as a possible cause.