Dice the onion and mince the garlic. Sauté both in a large pot with the cooking oil over medium heat for 3-5 minutes, or until transparent.
Add the chile powder, cumin, and cayenne to the pot. Continue to sauté for one minute to toast the spices. Add the masa harina or cornmeal and continue to sauté for 2-3 minutes to toast the starch. The corn will stick to the bottom of the pot as you sauté, so turn the heat down slightly if needed to prevent it from burning.
Whisk the vegetable broth into the corn mixture and allow it to come up to a simmer. The liquid will begin to thicken slightly when it starts to simmer. Add the tomato paste and stir until it dissolves in.
Add the can of diced tomatoes (with juices), black beans (drained and rinsed), and frozen corn kernels. Peel and cut the sweet potato into 1/2 inch cubes, then add it to the pot.
Cover the pot and allow the soup to come up to a simmer over medium heat. Once it begins to simmer, turn the heat down to low and let simmer for 30 minutes, or until the sweet potatoes have softened. Stir the soup occasionally as it simmers to keep the corn from sticking to the bottom of the pot. Taste the soup and adjust the salt if needed (this will depend on the brand of broth you use and the canned goods).
*The chili powder used here is a mild blend of chiles and other spices. It is not ground red chiles (like cayenne), which are usually very spicy. **You can whiz cornmeal in a food processor or blender to make it into a powder like masa harina.