STM32G474xx on NUCLEO-G474RE

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
User avatar
RealSparky
Posts: 17
Joined: Tue Sep 29, 2020 4:38 pm
Location: Carlsbad, California USA

STM32G474xx on NUCLEO-G474RE

Post by RealSparky » Tue Sep 29, 2020 5:24 pm

As a hardware guy, I believe MicroPython is the best thing since cheesecake was invented. For hardware test jigs it is just the best. I have an initial port running on the NUCLEO-G474RE and hoped to share with the community after getting a handle on Git. Then I realized this was what the community was all about, helping each other to get to the next level. Here is the issue, all my development is on Windows using EmBitz. My clean build time runs about 3 minutes on my modest Win10 machine. Today I'm adding the HRTIM PWM support and looking at my options. It appears the H743 triggered the need but it is just waiting in the AF tables. So if anyone is interested, I am glad to share my project and maybe we can get it forked. If you haven't checked out the STM32G4 series then I expect you will amazed with the signal processing capabilities. The HRTIM has 12 channels with an effective clock rate like 4.5GHz. Thank you MicroPython Community you are my heros.

User avatar
RealSparky
Posts: 17
Joined: Tue Sep 29, 2020 4:38 pm
Location: Carlsbad, California USA

Re: STM32G474xx on NUCLEO-G474RE

Post by RealSparky » Wed Sep 30, 2020 12:48 am

HRTIM what? This is the very item that attracted me to the G4 series and note table 2 that the G series uses version 2.0.

https://www.st.com/resource/en/applicat ... ronics.pdf

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: STM32G474xx on NUCLEO-G474RE

Post by jimmo » Thu Oct 01, 2020 12:50 pm

That sounds exciting! There has been a fair bit of interest in the STM32G port.

Please let us know if we can do anything to help with Git etc to help you get this merged.

joaquin
Posts: 3
Joined: Mon Aug 15, 2016 7:50 am

Re: STM32G474xx on NUCLEO-G474RE

Post by joaquin » Sat Dec 19, 2020 5:26 pm

Hi,
Interested as well, please let me know, if I could help.

adruder
Posts: 1
Joined: Tue Jan 12, 2021 9:36 pm

Re: STM32G474xx on NUCLEO-G474RE

Post by adruder » Tue Jan 12, 2021 9:46 pm

I am also interested in the STM32G4XX port. Do you have source posted anywhere for others looking to contribute?

joaquin
Posts: 3
Joined: Mon Aug 15, 2016 7:50 am

Re: STM32G474xx on NUCLEO-G474RE

Post by joaquin » Mon Feb 01, 2021 1:32 pm

Hi,

Thanks for your message, seems we are working in similar projects, I am using AS5048A/B, build a board with G473RC/E and making tests with that board using STM32CubeIDE by the moment, and I am also like to use micropython for this project. Motors are BLDC from Wantai at this stage. Board is : https://www.dropbox.com/s/9t8nq0fl304ar ... 1.pdf?dl=0

User avatar
RealSparky
Posts: 17
Joined: Tue Sep 29, 2020 4:38 pm
Location: Carlsbad, California USA

Re: STM32G474xx on NUCLEO-G474RE

Post by RealSparky » Wed Feb 03, 2021 10:33 pm

Hi Joaquin & Adruder,
Thanks for your interest in the STM32G4xx MicroPython port. My initial project that inspired the G4xx port just became active again today so, I will be releasing my initial port soon.

I also have the STM32 PMSM FOC firmware (X-CUBE-MCSDK) motion control running on the NUCLEO-G474RE evaluation board. Interesting enough that they still use TIM1 rather than the HRTIM1 for phase current control. I will do some initial testing with the TIM1 version and then switch to HRTIM1 before finishing my PCB layout. The code footprint is small enough and so should fit fine in the 512K FLASH with MicroPython. Glad to share my GCC Makefile project with you if you're interested. My design will be primarily for robotic manipulators using bi-polar 2 and 3 phase stepper motors. The layout uses the off axis magnetic position encoder for higher resolution and hollow shaft motor support.

best regards,
RealSparky, the hardware guy

joaquin
Posts: 3
Joined: Mon Aug 15, 2016 7:50 am

Re: STM32G474xx on NUCLEO-G474RE

Post by joaquin » Fri Feb 05, 2021 7:29 pm

Hi,

Thank you, I same interest as you, Manipulators using BLDC Motors and Micropython using STM32G4, at the moment using STM32CubeIde for this, but would like to port to G4.

Regards
Joaquin

User avatar
RealSparky
Posts: 17
Joined: Tue Sep 29, 2020 4:38 pm
Location: Carlsbad, California USA

Re: STM32G474xx on NUCLEO-G474RE

Post by RealSparky » Fri Feb 05, 2021 8:29 pm

Hi Joaquin,
You should install the ST Motor Control Workbench and STM32CubeMx together.
https://my.st.com/resource/en/data_brie ... -mcsdk.pdf
I had to transverse the procedure a few times to realize the power of the MCSDK. I used the 2 isolated shunt project for the STMG431RB to start. Some of the setup is activated by clicking on the GUI, like switching the control unit to G474. If you explore the app you will be able to setup PWM freq, motor currents, PID gains, resistor value... When you are done it will offer to open the project in CubeMX with the LQFP128 package. Under CUBeMX pinout tab look for "Export pinout w/ Alt Functions to move to the LQFP64 package. If you select use LL drivers it will return zero matches so use HAL initially. Then use the Project Manager Advanced settings to set drivers to LL and save the project. If you use a Makefile it needs a few tweaks, also fix the duplicated defines by renaming the stm32g4xx_hal_conf_template.h
AN5166 is a good app note to review.

Hope this helps,
RealSparky, the hardware guy

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: STM32G474xx on NUCLEO-G474RE

Post by mattyt » Tue Feb 09, 2021 11:12 am

Hey RealSparky,

I have one of the NUCLEO-G474RE boards; I'm keen to see that port progress! If you'd like me to review or test anything please let me know...

Cheers,
Matt

Post Reply