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

Atmel Start Framework builder #84

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

frankleonrose
Copy link

@frankleonrose frankleonrose commented Nov 11, 2019

As discussed in #33, here's my proposed Atmel Start builder.

Current issues (can be seen building examples/atmelstart-blink):

  • [Solved] PlatformIO issues a warning about the use of atstart_file option. Is there a way to silence that warning?

Warning! Ignore unknown configuration option atstart_file in section [env:AdafruitFeatherM0]

  • The packages downloaded are placed in ".pio/.downloads". Is there a better place to put the downloads folder? BUILD_CACHE_DIR? I'm thinking the downloads do NOT need to be removed on "clean", in which case maybe not the build cache. Is there a precedent for how to handle downloaded build artifacts?

  • The generated file peripheral_clk_config.h sets all clock frequencies to 0. This necessitates including build_flags as shown below. I plan to inject #pragma warning statements into the peripheral_clk_config.h so that users of the framework are warned when they have not successfully overridden frequency values.

build_flags =
  -D CONF_CPU_FREQUENCY=47972352
  -D CONF_GCLK_SERCOM0_CORE_FREQUENCY=47972352
  -D CONF_GCLK_SERCOM0_SLOW_FREQUENCY=32768

@ivankravets
Copy link
Member

PlatformIO issues a warning about the use of atstart_file option

If you need custom options in platformio.ini for your framework, please use board_build.%frameworkname%.atstart_file. Later in build script, board.get("build.xxxx.atstart_file")

@ivankravets
Copy link
Member

Atmel Start - is this a framework or configuration tool?

@frankleonrose
Copy link
Author

Atmel Start is a configuration tool that generates code that uses Atmel's Advanced Software Framework - ASF4. However, the two are tightly coupled. I think of it as Atmel Start generating a custom framework per project.

In order to break out ASF4 as an independent framework layer, it would have to include all possible hal/hpl/driver sources. Then the builder would have to select among them as appropriate for a particular board. This would essentially be replicating the work Atmel Start does when it generates the source package.

@ivankravets
Copy link
Member

How about to name it just framework = atmel-asf?

…ning

Also moved atstart file to be relative to project root.
@frankleonrose
Copy link
Author

Given the high degree of coupling, I don't see a problem with atmel-asf. From my perspective, the entrypoint is Atmel Start, which is why I used that name. But anybody in the ecosystem will understand.

Also moved artifacts into build/env directory and renamed ".downloads" to "atmelstart_downloads"
@ivankravets ivankravets requested a review from valeros November 12, 2019 17:28
Atmel Start puts examples and starter project files there that should not be built, like main.c, rtos_start.c, and sleep_manager_main.c.
@Mivr
Copy link
Contributor

Mivr commented Feb 21, 2021

Hi @frankleonrose, I do not know if there is still interest in this framework, however for the issue of zero clocks in the peripheral_clk_config.h there is a fix: Mivr/atmel-start@5e3b177 as it seems the external frequency should not be set (I will clean it a bit to remove the value before serialization, I have tested the change and it only affects the peripheral_clk_config in my test projects).
Also, there is a Go tool that has more functionality and might be a good idea to integrate into this PR?

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

Successfully merging this pull request may close these issues.

3 participants