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

Introducing a flexible build environment, especially improving STM32 builds #16536

Closed
wants to merge 5 commits into from
Closed

Introducing a flexible build environment, especially improving STM32 builds #16536

wants to merge 5 commits into from

Conversation

elagil
Copy link
Contributor

@elagil elagil commented Mar 5, 2022

Description

This aims to fix #16534.

Improved mcu_selection.mk for STM32

This PR introduces a separate mcu_selecion_stm32.mk, just for STM32 processors. It is loaded within mcu_selection.mk and requires much less manual work for adding support for new chips. Find it in builddefs/mcu_selection_stm32.mk.

Update all keyboards to specific processor models

I updated all affected boards (using STM32) with a specific processor variant.

For the processor variant, I selected the one, which is used as the default model in the current firmware, so everything builds just like before.

The new ProcessorFactory

This PR introduces a new ProcessorFactory, which replaces the old lists of supported chips. It assembles the list of supported processors by itself when it is provided with the corresponding information. For that, it uses the additional Processor class. See lib/python/qmk/processors.py.

Building

I tested all boards with their default keymap with

make all:default

all of them build fine. No errors were reported. See the build log here.

new_keyboard CLI

The new_keyboard CLI was adjusted as well, now presenting a list of all supported processors and memory configuration suffixes:

Output of 'qmk new-keyboard'
Ψ Generating a new QMK keyboard directory

Name Your Keyboard Project
For more infomation, see:
https://docs.qmk.fm/#/hardware_keyboard_guidelines?id=naming-your-keyboardproject

Keyboard Name? 0000

Attribution
Used for maintainer, copyright, etc

Your GitHub Username?  [elagil] 

More Attribution
Used for maintainer, copyright, etc

Your Real Name?  [elagil] 

Pick Base Layout
As a starting point, one of the common layouts can be used to bootstrap the process

Default Layout? 
        1. 60_abnt2
        2. 60_ansi
        3. 60_ansi_arrow
        4. 60_hhkb
        5. 60_iso
        6. 64_ansi
        7. 64_iso
        8. 65_ansi
        9. 65_iso
        10. 66_ansi
        11. 66_iso
        12. 68_ansi
        13. 68_iso
        14. 75_ansi
        15. 75_iso
        16. 96_ansi
        17. 96_iso
        18. alice
        19. ergodox
        20. fullsize_ansi
        21. fullsize_iso
        22. numpad_4x4
        23. numpad_5x4
        24. numpad_5x6
        25. numpad_6x4
        26. numpad_6x5
        27. ortho_1x1
        28. ortho_2x3
        29. ortho_2x6
        30. ortho_3x10
        31. ortho_4x10
        32. ortho_4x12
        33. ortho_4x16
        34. ortho_4x4
        35. ortho_4x6
        36. ortho_5x10
        37. ortho_5x12
        38. ortho_5x14
        39. ortho_5x15
        40. ortho_5x4
        41. ortho_5x5
        42. ortho_6x4
        43. planck_mit
        44. split_3x5_2
        45. split_3x5_3
        46. split_3x6_3
        47. tkl_ansi
        48. tkl_iso
        49. tkl_nofrow_ansi
        50. tkl_nofrow_iso
        51. none of the above
Please enter your choice:  [51] 1

What Powers Your Project
For more infomation, see:
https://docs.qmk.fm/#/compatible_microcontrollers

MCU? 
        1. MKL26Z64
        2. MK20DX128
        3. MK20DX256
        4. MK66FX1M0
        5. STM32F042x6
        6. STM32F072xB
        7. STM32F103x8
        8. STM32F103xB
        9. STM32F103xD
        10. STM32F103xE
        11. STM32F103xG
        12. STM32F303x8
        13. STM32F303xC
        14. STM32F303xE
        15. STM32F401xC
        16. STM32F401xE
        17. STM32F405xG
        18. STM32F407xE
        19. STM32F407xG
        20. STM32F411xC
        21. STM32F411xE
        22. STM32F446xC
        23. STM32F446xE
        24. STM32G431xB
        25. STM32G474xE
        26. STM32L072x8
        27. STM32L072xB
        28. STM32L072xZ
        29. STM32L073x8
        30. STM32L073xB
        31. STM32L073xZ
        32. STM32L412xB
        33. STM32L412xC
        34. STM32L422xB
        35. STM32L422xC
        36. STM32L432xB
        37. STM32L432xC
        38. STM32L433xB
        39. STM32L433xC
        40. STM32L442xB
        41. STM32L442xC
        42. STM32L443xB
        43. STM32L443xC
        44. GD32VF103
        45. WB32F3G71
        46. at90usb162
        47. atmega16u2
        48. atmega32u2
        49. atmega32u4
        50. at90usb646
        51. at90usb647
        52. at90usb1286
        53. at90usb1287
        54. atmega32a
        55. atmega328p
        56. atmega328
        57. attiny85
Please enter your choice:  [49] 24
Ψ Created a new keyboard called 0000.
Ψ To start working on things, `cd` into keyboards/0000,
Ψ or open the directory in your preferred text editor.
Ψ And build with qmk compile -kb 0000 -km default.

Further info

For the moment, I removed the check against keyboard.jsonschema and do all checking in Python directly. I find it sensible to only check for compatible processors in a single place.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation: Add more supported processors
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@elagil elagil changed the title STM32 more flexible build environment (mcu_selection.mk) STM32: Introducing a flexible build environment (mcu_selection.mk) Mar 5, 2022
@tzarc
Copy link
Member

tzarc commented Mar 6, 2022

I'd suggest putting this on hold to some degree until discussion occurs on #16534 -- if we go down a specific route it makes little sense making a whole bunch of changes only to find out that it's irrelevant after discussion.

@elagil
Copy link
Contributor Author

elagil commented Mar 6, 2022

I modified the new_keyboard CLI to work with the new ProcessorFactory. Here is how the new list of supported processors looks: Example.

Currently, I am test building all keyboards with their default keymap, so that I can catch any errors.

@elagil
Copy link
Contributor Author

elagil commented Mar 6, 2022

if we go down a specific route it makes little sense making a whole bunch of changes only to find out that it's irrelevant after discussion

@tzarc Yes, but I find it easier to discuss, when you have some code to look at. In this PR I will continue implemeting things as a basis for discussion and improvement.

@elagil elagil changed the title STM32: Introducing a flexible build environment (mcu_selection.mk) Introducing a flexible build environment, especially improving STM32 builds Mar 6, 2022
@drashna drashna requested review from zvecr, fauxpark and a team March 8, 2022 02:37
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold 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 Jul 21, 2022
@tzarc tzarc added in progress and removed stale Issues or pull requests that have become inactive without resolution. labels Jul 21, 2022
@tzarc
Copy link
Member

tzarc commented Jul 21, 2022

Exempting this from stalebot processing -- we want to get something along these lines in, eventually.

@elagil elagil closed this by deleting the head repository Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants