Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Adding support for the STM32H750 family MCUs? #20228

Closed
2 of 4 tasks
Jun-Amane opened this issue Mar 22, 2023 · 9 comments
Closed
2 of 4 tasks

[Feature Request] Adding support for the STM32H750 family MCUs? #20228

Jun-Amane opened this issue Mar 22, 2023 · 9 comments
Labels
enhancement help wanted stale Issues or pull requests that have become inactive without resolution.

Comments

@Jun-Amane
Copy link

Feature Request Type

  • Core functionality
  • Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Description

Hey guys,
I am trying to port the QMK to STM32H750 which already has a stm32_registry.h in the ChibiOS repo. I am wondering how can I do to compile the firmware for it?
When I tried to compile it after adding some configuration code, many errors occurred. So how could I build the firmware for other MCUs like STM32H750 which already have stm32_registry.h existed.

Thanks and Regards,
Jun ASAKA.

@drashna
Copy link
Member

drashna commented Mar 23, 2023

This isn't comprehensive, but the files that it would need to be added to:

  • data/schemas/keyboard.jsonschema
  • lib/python/qmk/constants.py
  • platforms/chibios/mcu_selection.mk

ANd I think a generic board needs to be added to platforms/chibios/boards as well.

@Jun-Amane
Copy link
Author

This isn't comprehensive, but the files that it would need to be added to:

  • data/schemas/keyboard.jsonschema
  • lib/python/qmk/constants.py
  • platforms/chibios/mcu_selection.mk

ANd I think a generic board needs to be added to platforms/chibios/boards as well.

Thanks four your reply.
Currently, I have modified the files above and also add a new board based on the DISCOVERY board. But when I flash the firmware into the device, it doesn't work (compile was successful).
I am tring to figure out the reason of it.

Regards.

@tzarc
Copy link
Member

tzarc commented Mar 23, 2023

You should be able to manually specify all the parameters in the keyboard's rules.mk, much like kinesis/kint41 does.

As for halconf.h or mcuconf.h -- assuming there's an existing set of configs in ChibiOS you can copy those from there into your keyboard directory as well.

Assuming they're all correct, you should be able to get the board to boot up. If/when you get to that point we can discuss how you go about doing things "properly" in order to get it into the repo.

@Jun-Amane
Copy link
Author

You should be able to manually specify all the parameters in the keyboard's rules.mk, much like kinesis/kint41 does.

As for halconf.h or mcuconf.h -- assuming there's an existing set of configs in ChibiOS you can copy those from there into your keyboard directory as well.

Assuming they're all correct, you should be able to get the board to boot up. If/when you get to that point we can discuss how you go about doing things "properly" in order to get it into the repo.

I think the board was booted up since GPIOs was initialized as how I configured. But the USB device doesn't showed up on my PC (nothing found in dmesg and lsusb), and when I want to do something in void keyboard_pre_init_kb(void), such as writePinHigh(E3); and still nothing happened.
So I am suspecting whether the board is really booted up.

@Jun-Amane
Copy link
Author

Jun-Amane commented Mar 23, 2023

I found that there are some problem in stm32_clock_init();(lib/chibios/os/hal/ports/STM32/STM32H7xx/hal_lld.c)
the function stuck at here:
while ((RCC->CR & RCC_CR_HSERDY) == 0);
...
while ((RCC->CR & rdymask) != rdymask);
...
while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != (STM32_SW << RCC_CFGR_SWS_Pos));
And when remove these three while loops, the board would booted up normally. So I think there are some issues when initialising the clocks.

@Jun-Amane
Copy link
Author

I found that there are some problem in stm32_clock_init();(lib/chibios/os/hal/ports/STM32/STM32H7xx/hal_lld.c) the function stuck at here: while ((RCC->CR & RCC_CR_HSERDY) == 0); ... while ((RCC->CR & rdymask) != rdymask); ... while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != (STM32_SW << RCC_CFGR_SWS_Pos)); And when remove these three while loops, the board would booted up normally. So I think there are some issues when initialising the clocks.

Oh yee. I just fixed it by removing #define STM32_HSE_BYPASS from board.h which made the HSE failed. And I think this should be customised according to the boards.
So what should I do to make a PR to support STM32H750?

Regards,
Jun ASAKA.

@tzarc
Copy link
Member

tzarc commented Mar 29, 2023

At this point your best bet is to discuss directly with the ChibiOS maintainers -- they're pretty responsive on their forums and/or Discord.

If a bugfix is provided on their stable_21.11.x branch, we can pull that in and get the ball rolling within QMK.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs.
For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jun 28, 2023
@tzarc
Copy link
Member

tzarc commented Jun 28, 2023

Feel free to tackle the same thing as #21352 once ChibiOS itself is fixed up.

@tzarc tzarc closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted stale Issues or pull requests that have become inactive without resolution.
Projects
None yet
Development

No branches or pull requests

3 participants