You can do it with some poke commands - you'd have to look in the chip's reference manual though. There's some info on how to access hardware here: http://www.espruino.com/STM32+Peripherals
But it doesn't specifically cover the oscillators.
The problem you might find is that the internal oscillator isn't good enough for USB, so the second you move to it, USB will drop out.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The high speed internal, or low speed?
You can do it with some
poke
commands - you'd have to look in the chip's reference manual though. There's some info on how to access hardware here: http://www.espruino.com/STM32+PeripheralsBut it doesn't specifically cover the oscillators.
The problem you might find is that the internal oscillator isn't good enough for USB, so the second you move to it, USB will drop out.
Out of interest, why do you want to do it? On newer builds (the ones from GitHub, or 1v86 when it comes out) can change the clock rate with
E.setClock
: https://github.com/espruino/Espruino/blob/master/src/jswrap_espruino.c#L780If you were doing it for reduced power consumption, you might find setClock is good enough for what you want.