Clouds xtal frequency

Morning everyone,

In a previous post (in the wrong section)

I’ve asked and obtained informations about swapping certain GPIO pins.

The reason was that I’m attempting a build of Clouds on perfboard using an STM405 board purchased from the usual suspects.

The GPIO re-assignment seemed to be working ok and the code compiles fine.

The module is fully built but I could use some more of your kind help understanding something.

The board has a 12mhz xtal whilst clouds uses 8mhz, would this lead to failure initialising the codec?

I’m fighting against ui panic.

Many thanks in advance for any help you can throw at me

You need to adjust these:

1 Like

Superb! Now let’s scratch my head about what’s the math.

Once again, I really appreciate you getting involved pointing out the correct path @pichenettes Thank you!

You can download from ST (but I have long forgotten where) a spreadsheet with all the clock and PLL parameters, showing all the resulting frequencies.

1 Like

Found the file but also StmCubeIDE has the clock calculation page.
The all thing has another variable within PLL configuration.
Variable “M” which seems the prescaler.
Would you mind if I ask you what it is set to?

wow two hours banging my head against the wall… no matter how I set the clock calculations, even with the 8mhz clock source, I don’t seem able to get down to 12.288mhz required by the codec.
taking the first set of instructions as an example
if (sample_rate == 48000) {
// 47.992kHz
RCC_PLLI2SConfig(258, 3);

I can set the “M” (straight after the PLL MUX in the infographic) from /4 to /8
any value outside these, will give me errors about range of PLL frequency (must be within 0.95 2.1MHZ)
staying whitin this values I can further use the I2S N and R but there is no way I get close to the needed value…
What I’m missing (beside the knowledge clearly)

Days later I have wrapped this up (failed) and changed the crystal to an 8Mhz one.

Next hallange now is to understand what triggers the panic UI.

As per the code below I believe that if the codec does not initiate correctly it causes the panic mode.

  ui.Init(&settings, &cv_scaler, &processor, &meter);

  bool master = !version.revised();
  if (!codec.Init(master, 32000)) {
  if (!codec.Start(32, &FillBuffer)) {
  if (settings.freshly_baked()) {

But i’m also thinking that when I try to calibrate I get the 4 red leds after I have done the 3volts step and as per code below it seems that the calibration procedure is failing to save.

void Ui::CalibrateC1() {

void Ui::CalibrateC3() {
  bool success = cv_scaler_->CalibrateC3();
  if (success) {
    mode_ = UI_MODE_VU_METER;
  } else {
    mode_ = UI_MODE_PANIC;

Which is the one that triggers first?


If you see this happening after trying to calibrate the module, then it indicates a calibration error. Otherwise, it is because the codec failed to initialize.

Thank you.

I get the panic UI when powering up the module (4 red leds) but also when trying to calibrate (4 red leds after the second step of calibration is completed)

I don’t under if the fact that it fails to calibrate also affects the power up sequence leading to panic UI and not functioning module or when it boots is the codec failure that leads to it.

Also, The blend knob does not “paint” any led, this leads me to think the main issue is calibration

At the risk of repeating myself (and repeating the code too), you see the panic sequence:

  • On startup, if the codec fails to initialize.
  • After performing the calibration sequence, if the module did not record the 1V and 3V voltages (withn some tolerances).

You thus have to solve two issues, one related to the codec, the other to the CV inputs.

No. You see the panic sequence on startup because the codec doesn’t initialize.

Not necessarily. It could be that the analog section does not work at all, and that the module reads a large negative CV on the BLEND CV input.

1 Like

Hello again,
Hope you all had a great Xmas.
Boxing Day headache is not because of the wine drunk yesterday but because I recently made some progress where the calibration and codec are concerned.
It does seem to do ok with calibration, no panic ui triggered when saving the second step.
Also boot up seems ok as I now get the chasing led sequence which should indicate everything is up and running.
New encountered problem: no audio in and clearly no audio out.
I can trace the signal up to the codec audio in Pin but then I don’t see any led activity nor any audio coming out. Everything else seems now ok: switches, gates in, blend knob, the UI seems fully responsive which leads me to thing FW is running ok. I’m using QFN package for the Codec as I can’t trace any ssop package available anywhere (before you ask, I’ve taken into account the different pin out) Joins look ok but then, I don’t really have/know of any way to test the Chip isolated. I guess my question for the gurus is: if the Correct boot procedure is happening the codec is initialising if the codec initialises which connection to the mcu can I exclude? I2C? I2S? Any connection in particular order? Many thanks just for taking the time to read this rant!

Firmware hacking discussions are frequent here but troubleshooting of DIY builds is not supported on this forum.

1 Like

Might be worth trying here for DIY

Thanks for the support received so far and apologies if it felt like I was disregarding the forum rules.
I understand that DIY builds are not Supported, this I guess might have something to do with the trillion clones that are out there in the DIY scene.
I just wanted to reassure that no business purpose is involved in my project as I’m doing this for my pleasure and challenge.

Yesterday night I have finally brought Clouds to life!

I appreciate the code explanations received by @pichenettes, they gave me a first insight on some aspects of STM. This project required reading multiple time the code trying to understand what in hell was going on and it has proven very usefull to gain a little knowledge of a project is held together.
I have now successfully put together Grids, Peaks, Plaits and Braids I’m finalising Clouds and I will be endeavouring in more MI projects on perfboard.
I might come back here for some questions but I’ll make sure those will be strictly code related.

Once again, THANK YOU

1 Like