Cut the sweet corn from the cobs. Discard or find another use for the cobs. Alternatively, use an equivalent amount (2 to 2 1/2 cups) of frozen sweet corn
Heat the vegetable oil in a stockpot or Dutch oven. Add the red pepper flakes and stir for a minute, allowing the pepper flavor to infuse the oil.
Add the onions, garlic, and peppers. Cook, stirring frequently, until the onions are softened
Add the oregano, cumin and chili powder. Cook until aromatic, 1 minute or so
Add the tomatoes and cook until heated.
Add the squash, sweet corn, and both types of beans. Add the stock. Stir and heat to a low boil, then reduce heat and simmer until squash is tender and the stock reduces/thickens (1 hour or so)
Add chopped cilantro and stir in. Season to taste. Serve