prepareSWD function

Prepare an SWD object