Foot and Knee Pain

I started today adding a short cardio session (no more than 10 minutes) with low to moderate intensity to finish my workouts. I chose to do the treadmill, walking at a good pace, at maximum incline. I noticed that I developed joint pain in my feet as well as knee pain. This is not the first time this happened to me. About a year ago I tried something similar and ended up with an inflamed knee.

The strange thing is that squats do not bother my knees at all.

I also do not have pain if I do the elliptical instead, but the elliptical is silly. Id rather do something more natural such as walking.

Any thoughts on what may cause the pain? I have flat feet btw, but I am not sure if that would cause such extensive discomfort.