The way I usually build spanning tree is have one vlan on the edge ports tagged and set it up for spanning tree, that way it doesn't matter which vlan is assigned to the ports dynamically, the spanning tree config stays static.
* create vlan net tag 20
* configure net ipaddress xxx.xxx.xxx.xxx 255.255.255.0
* configure vlan net add ports 45 untagged (This is uplink port to core)