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

Develop code structure to support many target architectures #149

Open
susanw1 opened this issue Nov 28, 2023 · 0 comments
Open

Develop code structure to support many target architectures #149

susanw1 opened this issue Nov 28, 2023 · 0 comments
Assignees

Comments

@susanw1
Copy link
Owner

susanw1 commented Nov 28, 2023

It's hard to build a source-tree where mostly the same code supports many hardware devices. Eg we are targeting 3 ARM MCUs at the moment, but there are actually >1000 distinct STM32 devices with different generations of different sub-systems in each. But the thing we want to produce is a working build for a user-selected specific device. How to handle this?

Goals:

  • Confine the number of build-modules (previous attempt needed >1 build-module per target device, so avoid that - too fine grain)
  • Simple include paths
  • Supports multiple low-level interfaces (eg ZLL, Arduino, etc) for a given peripheral
  • Supports multiple implementations of those interfaces (eg polling vs interrupt-driven vs DMA)
  • Supports interaction between peripherals without coupling them together
  • Allows user-level config to specify pins, DMAs etc
  • Gives (meaningful) compile error on invalid setups

Options for how the device source-tree should be segmented:

  1. One build-module overall - single source-tree (!). Simple, structure, hard to find things, any change re-releases everything;
  2. One module per manufacturer (STM32, Texas etc). Keeps the wildly different low-level code in different places.
  3. One module per interface (ZLL, Arduino, etc)
  4. Combination: One source-tree per interface/manufacturer.

After discussion, we like option#4. Something like "Arduino" is built on the Arduino HAL, which hides device detail. But the Zscript ZLL implementation needs to be divided by manufacturer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants