grblHAL / STM32F4xx

grblHAL driver for ST STM32F4xx (Nucleo-64, Blackpill)
Other
94 stars 87 forks source link

Targeting other F4xx MCUs #40

Open ClockedLogic opened 3 years ago

ClockedLogic commented 3 years ago

Hi Folks, I would like to know how to target the STM32F405RG6 or other MCU . Is there a guide to do this ? or is it assumed knowledge? I've no been able to find the details in the documentation.

There are several boards out there now using this MCU.

I'm building with STM32CubeIDE.
What files do I need to bring in from CubeMX? How do I configure CubeIDE to biuild for this or any other MCU?

Many thanks, ClockedLogic

terjeio commented 3 years ago

Is there a guide to do this ?

No.

or is it assumed knowledge?

Kind of - it requires some knowledge of the MCU in question and/or an ability to understand the reference manual. Some knowledge of how to configure a project in the IDE is a plus.

What files do I need to bring in from CubeMX?

None, as this project is for the STM32CubeIDE.

How do I configure CubeIDE to biuild for this or any other MCU?

I assume you have loaded the grblHAL project already, if not it is described here. What I have done for other STM32F4xx processors is creating a new project from scratch for the target MCU and use that to set up the clock tree and sometimes also write a bit of code to test USB CDC comms if that is relevant. Then I copy the MCU specific files from that to the grblHAL project and integrate the clock tree setup into main.c. After that I add build configurations for debug and release to match the MCU, create the necessary board map file(s) and check that everything works. Oh, and depending on the target MCU linker (.ld) file(s) may have to be added as well. For that bootloader/no bootloader and settings storage in flash has to be configured according to requirements.

The MCU specific files are located in the CMSIS/Device/ST/Include folder, the clock tree setup is here.

Note that this project can only be extended to support other F4xx processors, if from another family a new driver has to be created.

willtel commented 3 years ago

Hi Terje,

Does this also apply to the F7xx Processors?

I am looking at using Nucleo-144 STMF446ZET6 or Nucleo-144 STMF746ZGT6 they were the only

STM32 MCUs I could get here in Australia.

I am still waiting on components to build up a Test Bed to try your Fantastic grblHAL on these boards.

Cheers willtel

On Wed, Oct 27, 2021 at 8:36 AM Terje Io @.***> wrote:

Is there a guide to do this ?

No.

or is it assumed knowledge?

Kind of - it requires some knowledge of the MCU in question and/or an ability to understand the reference manual. Some knowledge of how to configure a project in the IDE is a plus.

What files do I need to bring in from CubeMX?

None, as this project is for the STM32CubeIDE.

How do I configure CubeIDE to biuild for this or any other MCU?

I assume you have loaded the grblHAL project already, if not it is described here https://github.com/grblHAL/core/wiki/Compiling-GrblHAL. What I have done for other STM32F4xx processors is creating a new project from scratch for the target MCU and use that to set up the clock tree and sometimes also write a bit of code to test USB CDC comms if that is relevant. Then I copy the MCU specific files from that to the grblHAL project and integrate the clock tree setup into main.c. After that I add build configurations for debug and release to match the MCU, create the necessary board map file(s) and check that everything works. Oh, and depending on the target MCU linker (.ld) file(s) may have to be added as well. For that bootloader/no bootloader and settings storage in flash has to be configured according to requirements.

The MCU specific files are located in the CMSIS/Device/ST/Include folder https://github.com/grblHAL/STM32F4xx/tree/master/Drivers/CMSIS/Device/ST/STM32F4xx/Include, the clock tree setup is here https://github.com/grblHAL/STM32F4xx/blob/867c49e6e81cd3931d4509120a7cc9b2d018f82b/Src/main.c#L50-L212 .

Note that this project can only be extended to support other F4xx processors, if from another family a new driver has to be created.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grblHAL/STM32F4xx/issues/40#issuecomment-952380581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5DYJ4Z5IGFQSQAYANRMHDUI43PXANCNFSM5GYX2DMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

terjeio commented 3 years ago

Does this also apply to the F7xx Processors?

Yes, the F7xx driver is only targeting F756 for now.

STM32F446 is already supported by the F4xx driver.

hankecnc commented 3 years ago

它们是我在澳大利亚唯一能买到的 STM32 MCU I seem to understand why Terje Io has to make drivers for many different processors. It is very convenient for us to buy microcontrollers and make circuit boards (even for free, 2 opportunities per month).

muhammadelmogy commented 2 years ago

Hello, is there any updates on how to add new MCU, It would be very nice if there is basic guidelines that shows exactly what files I need to add to the core or/and modify I hope someone can do this and add it to the repo, so anyone else will be able to add a new MCU in the future, currently I am thinking about adding support to SAME54/51 With CANBus support and I hope to start this soon but without some kind of somewhat clear guide line it will take more time than it should be!

terjeio commented 2 years ago

@muhammadelmogy See this issue about a new SAME53 driver. SAME54/51 is perhaps similar so can share code and you can thus join that effort?

dresco commented 2 years ago

Just following this ticket, as I've got a vague interest in CAN support, and would love to see a plugin developed for it. I was planning on taking a closer look at it one day, when I can find the time..

(My prototype control panel is currently using Modbus for communications, but I think CAN bus would be a better choice where available).