[chbot] AI help with STM32
Mark Atherton
markaren1 at xtra.co.nz
Thu Jul 3 03:42:03 BST 2025
Ha! Well done Richard.
.. and thanks Charles.
-Mark
On 03-Jul-25 2:32 PM, Richard Jones wrote:
> I used the HAL to configure registers as needed, then read out the
> results in code to write the instructions to load registers directly for
> speed. In my case I printed the results as 'C' code using printf ( using
> bit band or register writes ) so I just cut and pasted the printed 'C'
> code into the application. Not at all portable, and not obvious to read,
> but I achieved the speed that I needed at the time.
>
> Cheers
>
> Richard
>
> On Thu, Jul 3, 2025 at 12:56 PM Charles Manning <cdhmanning at gmail.com
> <mailto:cdhmanning at gmail.com>> wrote:
>
> OK, I can't help in your stated quest of an AI assistant, but here
> is how I tend to go about STM32 development which might get what you
> want.
>
> First I use the CubeMX tool to do all the primary set up (peripheral
> initialisation, clock trees, dma channel assignment etc).
> For some of the peripherals, the performance is not too critical and
> the HAL podge is not too podgy. The HAL can work there.
> Then there are the few bits where the HAL is too bloaty and/or slow
> and/or missing the features you want. That is where I write my own
> drivers and bypass the HAL.
>
> It is OK to mix and match like that. It means you only need to go
> datasheet mining in a few critical places.
>
> Obviously you don't want to do things like write to the
> peripheral at the same time via HAL and your own code, but it is OK
> to use HAL to set things up, then apply your own tweaks then use
> your own code to do all the read/write stuff etc.
>
> This has worked well for me in the past and gives me the best of
> both worlds (well most of the time anyway).
>
>
> On Thu, Jul 3, 2025 at 10:49 AM Mark Atherton <markaren1 at xtra.co.nz
> <mailto:markaren1 at xtra.co.nz>> wrote:
>
> Hi Charles,
>
> You are quite right, I could just dig straight into the
> documentation,
> but at last count, there are something over 2,600 pages
> associated with
> the STM32G491.
>
> I was rather hoping to implement then experiment with some new
> ideas,
> rather than go into battle over trying to get peripherals
> configured.
>
> I am also quite shameless in terms of asking for help in any
> form that
> might be available.
>
> Anyway, can anyone recommend an AI assistant that might be
> useful in my
> journey ?
>
> Thanks,
>
> Mark
>
> ----------
>
> Charles Manning said
>
> What's wrong with the grey stuff sitting on your shoulders?
>
> The HAL normally has multiple modes of operation, including DMA
> options,
> but if you're pushing the micro hard the HAL is often a bit
> bloated and
> slow.
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> <mailto:Chchrobotics at lists.ourshack.com>
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> <https://lists.ourshack.com/mailman/listinfo/chchrobotics>
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> <http://lists.ourshack.com/pipermail/chchrobotics/>
> Meetings usually 3rd Monday each month. See http://kiwibots.org
> <http://kiwibots.org> for venue, directions and dates.
> When replying, please edit your Subject line to reflect new
> subjects.
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> <mailto:Chchrobotics at lists.ourshack.com>
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> <https://lists.ourshack.com/mailman/listinfo/chchrobotics>
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> <http://lists.ourshack.com/pipermail/chchrobotics/>
> Meetings usually 3rd Monday each month. See http://kiwibots.org
> <http://kiwibots.org> for venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
More information about the Chchrobotics
mailing list