-
Notifications
You must be signed in to change notification settings - Fork 111
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 ASF3 as alternative framework? #33
Comments
Are familiar with Python? Our build system is based on SCons tool https://scons.org/ We would be happy to have support for ASF. |
I'm back... The one thing I had to change was the GCC version. It would not compile with 1.40804. I knew it worked with the lastest
Thanks |
In addition, many of the modules within ASF have user configuration header files. for example, when you install FreeRTOS-10.0.0 with ASFWizard in Atmel Studio, |
I'm definitely interested in helping out on this as I can, as getting off Arduino is high on my list right now. If you have the order of library search for the SAMD21 from Atmel Studio, that would be greatly appreciated. No Windows machines here, unfortunately. |
Yes, here is a list of all the files I had to include for ASF3: https://github.com/Timvrakas/Code_Demo/blob/pio/lib/ASF3/library.json However, I didn't realize that there was a ASF4 available, and it's far superior in my opinion. If a get a chance, I'm going to try to get that working. The real cool feature of asf-pio integration would be code generation similar to Atmel Start. Pull pin names/pin modes/mux/timer/sercom configuration from a JSON file or something, and generate all the headers at compile time. But honestly that large of a project would probably only be doable with support from Microchip. But basic compiling is doable in the short term. |
Thanks! Looking at ASF4 now -- that Start tool is painfully slow. I did see that Adafruit has some extracts, but they tend to only pull what they need to support their own boards and code. |
I did get this working. My code is here: https://github.com/stanford-ssi/spacesalmon |
I'm considering working on an ASF framework. I have some questions and I'd appreciate guidance, @valeros.
Thanks for your help. |
Hi @frankleonrose !
I'm not familiar with ASF ecosystem, but if it's possible to compile this framework using GCC toolchain then we're mainly interested in sources and build flags that can be possibly used for compilation. According to the ASF doc page, ASF3 indeed looks like a better choice.
In any case we need to repack framework because we rely on a special utility manifest with package metadata (name, version, url, etc).
Pretty much all frameworks require some build logic, file filtering is not a problem as long as the structure of the framework is consistent. You can take a look at the build script for stm32cube that might have some answers.
I've never used ASF and not familiar with the typical workflow, but it should be fine to create a
That's correct. |
Thanks, @valeros.
I assume you mean to generate these files while re-packaging the framework, as opposed to after installation. (Since there is no post-install hook.) Also, copying the platform package (with platform.json and platform.py files and everything) to $PLATFORMIO_HOME/platforms/asf is sufficient to install it for testing? |
I'm using ASF4 with PlatformIO for this project.
https://github.com/stanford-ssi/SpaceSalmon
ASF4 is better than ASF3, but is not very good. More exposed than Arduino
to be sure, but some broken libraries (SPI async) and lots of pointless
code. I question the value of having it built in as a PlatformIO framework
beacuse anyone who's trying to use it should be expecting to edit it for
their needs. It's a good starting point, but I just have it included as a
local library.
The end game for this chip family IMO is a Python configuration tool. Like
Atmel Start, but executed at build time, and pulling configuration from
some JSON or something. Automatic config checking to look for errors ("your
CPU has no GCLK connected!"). Then it generates a single layer framework
for exactly the hardware configuration you've specified, including
initialization code.
But that sounds like a project for someone at Microchip.
Tim
…On Tue, Oct 15, 2019, 06:14 Frank Leon Rose ***@***.***> wrote:
Thanks, @valeros <https://github.com/valeros>.
Eventually, it might be a good idea to dynamically generate these files.
I assume you mean to generate these files while re-packaging the
framework, as opposed to after installation. (Since there is no
post-install hook.)
Also, copying the platform package (with platform.json and platform.py
files and everything) to $PLATFORMIO_HOME/platforms/asf is sufficient to
install it for testing?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33?email_source=notifications&email_token=AATF55DU7TXWVQJI4MHB4STQOW65DA5CNFSM4FMS6R72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBIWMDI#issuecomment-542205453>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATF55ATIAG4NUTFDE3CKQTQOW65DANCNFSM4FMS6R7Q>
.
|
That's an excellent point, @Timvrakas. Having now spent more time with the idea, I agree. Here's how I'd like to use ASF4. You put three files in a lib directory:
You'd build with no |
Hi, I've used Atmel Start to configure my mcu, with the peripherals and necessary ASF4 libraries, I needed for my project. I was able to download the atstart zip package, and after installing the arm compiler, compile the project using the produced make file. I can upload the hex file using the cli tools from segger, but there it ends. I would really like to use all the goodness from platformio, to further extend and develop my project, especially since the unified debugger from platformio already supports the Segger JLink. Since I'm working on OSX, using Atmel Studio is not an option. So could someone explain me how you can import an atmel start project and configure platformio to use the atmel config? I guess you need to define a custom board, and platformio.ini file. do you need to develop custom python files to get it compiled or can it use the make file? |
@JelleRoets Check out this example and let me know how it works for you. https://github.com/frankleonrose/AtmelStart_PlatformIO/tree/master/examples/AdafruitFeatherM0 . Just run
It caches the downloaded files, naming them with the hash of the JSON used to generate them, so it doesn't have to repeat work. To make a custom board specification, check out https://docs.platformio.org/en/latest/platforms/creating_board.html . If your board has a bootloader, make sure to specify an |
I realize after re-reading this thread that the builder code in https://github.com/frankleonrose/AtmelStart_PlatformIO/library.py could actually just be added here as 'builder/frameworks/atmelstart.py' without many changes. Lemme see how that works... |
Hi @frankleonrose, Unfortunately I couldn't run your scripts out of the box when cloning your above repository, I had a couple of issues:
However I was able to fix these issues and make a working blink example for the arduinoZero using Atmel Start and ASF4. Please take a look at https://github.com/JelleRoets/AtmelStart_PlatformIO or as a diff: frankleonrose/AtmelStart_PlatformIO#1. I'd love to hear your feedback. I've also added a readme that describes how to get started with your own custom project. |
Yes, see https://github.com/platformio/platformio-core/blob/develop/platformio/builder/main.py#L99 We recommend using PIO Core 4 Build API.
Could you provide more details?
If this is a framework, it is better to add support directly to this repository instead of a library. |
Heres's the framework builder, @ivankravets: #84 Resolving some CI issues. (This is one place where CircleCI does a good job - easy to run jobs simply using |
In @frankleonrose original repo https://github.com/frankleonrose/AtmelStart_PlatformIO/blob/8e181332d488b9cec046ae529bd8617d6076a203/library.py#L208 he set LDSCRIPT_PATH with the correct linker script file. However setting that field didn't change the linker command for me (that might be due to specific platform build scripts in the atmelsam repo, but didn't figured that out). |
I'm working on a project that uses both ATSAMC21's and ATSAME54's, and I have found microchip's frameworks maddening. Three solutions, and all of them have major issues regarding usability. Harmony 3/mplab doesn't directly support gcc - not that I'd use mplab anyway - it has to be the worst IDE out there. Harmony 3 also doesn't support SPI slave. ASF4 is a nightmare (buggy as has been mentioned) and because of the disaster that is START. And then there is ASF3 - so far it is the most usable, although it is a PITA to configure. I like microchip's silicon, but their tooling is just a mess. I am tempted to write a C++ framework based on a blend of harmony 3 and ASF 3. |
I ended up dropping ASF4 and restructuring my pretty sizable project to use the Adafruit Arduino Core. It has its own issues, but not as many, and for advanced peripheral interfacing you're never going to escape doing some of the work yourself. If you're considering using ASF, this is a warning! The promise of vendor libraries is hollow. (Aside from the CMSIS headers are great) |
I'll take a look at Arduino Core. And yes very hollow! |
Ah. I remember looking at adafruit's core but it doesn't support the SAMC21. It probably wouldn't take much to add it though. |
I'm interested in using PlatformIO to develop for the SAMD21 series, using the Atmel Software Framework. To achieve this, I need to set up ASF as a framework correct? Like framework-arduinosam, but it would be "framework-asf" or something like that.
Where should I look to get an idea of how to achieve this? Is there any relevant documentation? For the short term i'm just looking to port SAM21G18A, but I could expand that to more of the ASF later on.
I'm new to PIO, so any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: