Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.19.2)

project(Blinky C)

find_package(Harmony REQUIRED)
find_package(SAMV71-DFP COMPONENTS SAMV71Q21B REQUIRED)

add_harmony_config(
MCU_MODEL ATSAMV71Q21B
YAML_FILES
./mcu-config/core.yml
./mcu-config/dfp.yml
./mcu-config/efc.yml
)

add_executable(Blinky)
target_include_directories(Blinky PRIVATE include/)
target_sources(Blinky PRIVATE src/main.c)
target_link_libraries(Blinky PRIVATE samv71-dfp::SAMV71Q21B::Startup samv71-dfp::SAMV71Q21B::Linker::Flash Harmony::SysInit Harmony::PeripheralDrivers)
26 changes: 26 additions & 0 deletions examples/blinky/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SAMV71 blinky example

This example blinks the User LED on a SAMV71 Xplained Ultra board
with a 1 sec interval.

## Building

To build this, run the following (assuming you have installed the
Conan packages)
- `conan build . -pr=baremetal-samv71-armv7 -s build_type=Debug`

If for some reason you want to run the build manually, these are
the steps:
- `conan install . -pr=baremetal-samv71-armv7`
- `cmake . -Bbuild/Debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=./build/Debug/generators/conan_toolchain.cmake -GNinja`
- `cd build/Debug/`
- `ninja`

The produced `Blinky.elf` file can be found under `./build/Debug/`.
For a release build, change `Debug` to `Release` in all the commands above.

## Uploading

Use your favorite debug/flash tool for uploading. Refer to your tool's documentation
or to the main `README.md` file for a basic procedure using [OpenOCD](https://openocd.org/)

15 changes: 15 additions & 0 deletions examples/blinky/atmel_samv71_xplained_ultra.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: GPL-2.0-or-later

#
# Atmel SAMV71 Xplained Ultra evaluation kit.
# http://www.atmel.com/tools/ATSAMV71-XULT.aspx
#
# To connect using the EDBG chip on the dev kit over USB, you will
# first need to source [find interface/cmsis-dap.cfg]
# however, since this board also has a SWD+ETM connector, we don't
# automatically source that file here.

set CHIPNAME samv71

source [find interface/cmsis-dap.cfg]
source [find target/atsamv.cfg]
36 changes: 36 additions & 0 deletions examples/blinky/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout


class BlinkyRecipe(ConanFile):
name = "BlinkyExample"
version = "1.0"
package_type = "application"

# Authorship metadata
license = "MIT"
author = "Grigoris Pavlakis <[email protected]>"
url = "https://github.com/PeakSat/minimal_dev_setup"
description = "Blinky example for Atmel SAMV71 Xplained Ultra"

settings = "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"

# Dependencies
requires = "samv71-dfp/4.9.117", "harmony/3.0"

# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "src/*"

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

Loading