How have you identified that STP on the router is the culprit? If you take the output of a "show STP" on each of your routers/switches, you should be able to see where the spanning tree's root is.
Running a packet trace with Wireshark or something similar would show the broadcast storm in progress, if that's what's happening, and hopefully point you in the direction of the box responsible.
Update after you provided a diagram:
You already have a circle there at the bottom half of the diagram. It looks like the ACEs don't bridge, so if you don't have a problem there you shouldn't have a problem connecting the two top ones.
It's a bit hard to talk about the diagram if you don't name the devices, but let's say I name them left to right, top to bottom. You have a circle ACE1-SW3-ACE2-SW4-ACE1..., obviously there's no problem there (right?). I'm guessing you configured the ACEs so they don't bridge any traffic at all, and therefore no loop.
Why not connect ACE1 to SW2 and ACE2 to SW1? Then you have the same setup as the bottom part.
If you have a different VLAN in the top and bottom parts (not the same layer2 segment) then you can't have a spanning tree loop between them.
It would be clearer if you provided (obfuscated if you like, but make sure we can tell network A from B. Such as 10.123.0.0/24 and 10.123.1.0/24) IP networks on the map, and perhaps VLANs (if you use them).
Update after naming the switches:
If the ACE do routing, and therefore are the next-hop for the servers on 10.0.0.0/24 etc.., and don't do bridging (in the ACEs), then connecting the way I said above is safe.
Best Answer
You need to use the Edge command, either by range or per port.
edit - here's a guide