I damaged my foot by using the treadmill. There were no bones broken, but it took 9 months before I could walk on it properly. I damaged the fibrial posterial tendon.
When I hurt my foot badly by falling into a hole in the ground accidently, I applied lots of yogurt and strapped it up and elevated the leg. I was wheeled in to get my foot xrayed at hospital the next day. And walked out fine - miracle!
Sounds like a torn ligament. It does take months almost a year to back to normal if you did tear it. if it is a sprain then it will still take months. It could be a nerve that got pinched. But nerve pain is usually burning pain or a radiating pain and not sharp. When I torn a ligament in my back I couldn't lift my foot either for a couple of months and could hardly walk for a long time. It will heal if that is the case.
It might be "gout." look it up and ask your doctor about it.
Did you get the whole foot xrayed?
Rather than it being bone problem you may have a tendon and soft tissue problem.
Elevate the foot as much as you can. Apply lots of natural yogurt and wrap a bandage, cloth or towel to support the foot. Yogurt helps by reducing any inflammation.
Did you do any running, jogging or gym work on the treadmill?
If the pain still continues after you have done the above for a few days to a week, you will need to make an appointment with your doctor again.