<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Yes it should generate all the clocking arrangements, and allocate and initiate the relevant pins.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Pure guess, but try changing the selected processor to a STM32F730 or STM32H750 and see if it generates more code<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of rburnett@richieburnett.co.uk <rburnett@richieburnett.co.uk><br>
<b>Sent:</b> 16 July 2023 12:42<br>
<b>To:</b> Synth Diy <synth-diy@synth-diy.org><br>
<b>Subject:</b> Re: [sdiy] STM32G4 SAI problems</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Thanks for all your tips and suggestions with this guys. I really
<br>
appreciate it. Particularly the STM32 gotchas which will be handy <br>
generally as I'm new to STM32.<br>
<br>
I've gone through the output generated by the graphical config tool <br>
CubeMX and it doesn't seem to contain anywhere near enough code. For <br>
example when I enable one of the peripherals like I2S the pins light up <br>
around the package drawing and take on the labels I2S2_MCK, I2S2_SD, <br>
I2S2_CK & I2S2_WS and appear in a little table in the "GPIO settings" of <br>
the "Configuration" window but there doesn't seem to be any <br>
corresponding code generated to actually perform this pin configuration. <br>
All I can see in the automatically generated code is config for a pin <br>
with a LED attached (which works!) and a pushbutton which I haven't <br>
tested. Likewise all of the clocks look valid and enabled in the RCC <br>
clock tree diagram and appear to be being fed to the I2S peripheral, but <br>
I can't actually find anything in the generated code to make this <br>
happen! This would seem like a decent explanation for why the relevant <br>
pins just appear floating (tri-stated) when probed with the scope.<br>
<br>
Am I right in thinking that CubeMX should be automatically generating <br>
code to configure pins correctly when I enable a peripheral like I2S? <br>
They're names change and they light up in the pin diagram and appear in <br>
a table, but am I meant to be writing the code to switch the pins from <br>
tri-state to the correct "Alternative Function" myself? Likewise with <br>
the clock enabling. I can't actually find the line of code that enables <br>
the bus clock to the I2S.<br>
<br>
I'm relatively new to this idea of using a graphical config tool to <br>
configure peripherals although by no means new to embedded firmware <br>
development. As others have said its a nice idea when it works, but <br>
when it doesn't you're left trawling through loads of automatically <br>
generated spaghetti code referencing multiple sprawling include files <br>
(>.<) At this point I can't help but feel like abandoning the graphical <br>
config tool and just grabbing a highlighter and printing out the <br>
relevant 55 pages or so of the device manual and thrash my way through <br>
writing the peripheral configuration manually. (The actual I2S protocol <br>
part and the ping-pong DMA buffering, etc. that comes next is familiar <br>
to me from projects on other platforms, so I'm confident of what I'm <br>
trying to achieve. I should be able to answer the questions of what <br>
bits to set/clear to talk to my chosen CODEC chip.) It just doesn't <br>
seem like the graphical config tool is even asking anywhere near enough <br>
questions or generating enough code.<br>
<br>
For example, the timings that Vlad quoted would be perfect for me. I <br>
just can't make it do that (>.<)<br>
<br>
Perhaps I'm putting too much faith in the IDE tool. Is there a fair <br>
chance that the graphical config tool (CubeMX) is just broken? I have <br>
read some pretty scathing stuff about CubeMX and HAL in other forums, <br>
but had hoped things had improved over the years.<br>
<br>
-Richie,<br>
_______________________________________________<br>
Synth-diy mailing list<br>
Synth-diy@synth-diy.org<br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use marketplace@synth-diy.org<br>
</div>
</span></font></div>
</body>
</html>