CPU-switch interconnect has to be member of appropriate VLANs:
/interface ethernet switch vlan
add ports=switch1-cpu,ether2 switch=switch1 vlan-id=10
add ports=switch1-cpu,ether3 switch=switch1 vlan-id=20
Keep in mind that, from switch chip point of view, the CPU-switch interconnect (switchX-cpu) is "yet another" port and has to be configured in exactly the same way as other switch ports. So it has to be member of a VLAN when a) device interacts with that VLAN (e.g. it's routing trafic or VLAN is used for management) or b) CPU passes L2 frames towards other interfaces, such as wireless interface.