In this paper, we study the interdependency between leakage energy and chip temperature on embedded systems. We present a DVFS approach targeted towards a task sequence aimed to minimize total energy dissipation. This approach determines an appropriate execution frequency based on the current temperature, thermal state, and task's characteristics. Our method utilizes the Performance Monitor Unit (PMU) and on-chip temperature sensor to collect the statistics needed for frequency selection. We design an online algorithm to regulate frequency at each switch point. We have implemented the proposed technique in Linux 184.108.40.206 running on an Intel Pentium M750 platform. Our measurements show that we can achieve average 21.6% total energy savings.