Skip to content

Commit

Permalink
Add an AS7-style project with more of the Eval boards defined as targ…
Browse files Browse the repository at this point in the history
…ets.

(Previous AS support was for v6.x)
This is a single "solution" with multiple "projects" for each board.
  • Loading branch information
WestfW committed Oct 8, 2021
1 parent e4187d8 commit c9bbfb2
Show file tree
Hide file tree
Showing 14 changed files with 1,371 additions and 0 deletions.
53 changes: 53 additions & 0 deletions optiboot/AS7/AS7-README.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Building Optiboot with Atmel Studio (or Microchip Studio.)

This is made based on Atmel Studio version 7 (AS7)

There is one "Solution" containing multiple projects, one project for each
of the common Microchip Development boards that might "want" to use
Optiboot. A big advantage of using AS7 with one of the development boards
is that it allows for debugging using the AS7 debugging features (the
development boards have built-in debug support as well.)

Building:

To use AS7 to build one of the Optiboot versions, open the "Optiboot.atsln"
file from Studio (or double-click on it in Explorer.)

"Build Solution" will compile all of the projects. To build a single
project, select the desired project/board in the "Solution Explorer" and
then use "Build xxx" from the Build menu. To debug, right-click on the
project and select "Set as StartUp Project" before using "Start Debugging
and Break" from the DEBUG menu. You may need to change he Debug "Tool"
setting in the Project Properties as well (my experience is that if you have
an actual hardware tool plugged in, AS will automatically offer it for
selection.)


How things work:

All of the AS projects are built using an "external makefile", so they're
not "real" AS projects in the sense that you could change toolchain settings
and have them take effect. In theory, this means that you can add
additional projects to support any of the other targets supported by the
Optiboot Makefiles. In reality, there is an unknown problem with recursive
makes, so that you have to (for example) build the curiosity4809 board as
make -f Makefile.mega0 optiboot_atmega4809.hex UARTTX=B0 LED=F5 ...
instead of
makef Makefile.mega0 curiosity4809

The Project should be set for the correct Device, the "Build" Panel should
point to the .../bootloaders/optiboot/Makefile (or Makefile.mega0 for mega-0
anx xTiny chips.)

The "Build Commandline" should contain the makefile target, and also
PACKS="$(DEVICE_STARTUP_ROOT)" if the chip is dependent on a Pack being
installed. The "Build Events" should copy the .elf file produced by the
makefile:
copy optiboot_attiny817.elf $(MSBuildProjectName).elf

The current Projects are all "flattened" somewhat from the directory
structure that AS would have produced, but that requires manual editing and
isn't necessary.

For the sake of clarity, not all of the files actually used in an optiboot
build are shown as "Solution Items."
68 changes: 68 additions & 0 deletions optiboot/AS7/Optiboot.atsln
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_xplained328p", "Projects\Optiboot_xplained328p.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3773CCBD-E79E-4D62-B530-E1CCDB09D098}"
ProjectSection(SolutionItems) = preProject
AS7-README.TXT = AS7-README.TXT
..\bootloaders\optiboot\boot_opt.h = ..\bootloaders\optiboot\boot_opt.h
..\bootloaders\optiboot\Makefile = ..\bootloaders\optiboot\Makefile
..\bootloaders\optiboot\Makefile.mega0 = ..\bootloaders\optiboot\Makefile.mega0
..\bootloaders\optiboot\optiboot.c = ..\bootloaders\optiboot\optiboot.c
..\bootloaders\optiboot\optiboot_x.c = ..\bootloaders\optiboot\optiboot_x.c
..\bootloaders\optiboot\parse_options.mk = ..\bootloaders\optiboot\parse_options.mk
..\bootloaders\optiboot\pin_defs.h = ..\bootloaders\optiboot\pin_defs.h
..\bootloaders\optiboot\pin_defs_x.h = ..\bootloaders\optiboot\pin_defs_x.h
..\bootloaders\optiboot\pins_rs485.h = ..\bootloaders\optiboot\pins_rs485.h
..\bootloaders\optiboot\pins_softuart.h = ..\bootloaders\optiboot\pins_softuart.h
..\bootloaders\optiboot\stk500.h = ..\bootloaders\optiboot\stk500.h
EndProjectSection
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_xplained328pb", "Projects\Optiboot_xplained328pb.cproj", "{1FCE634C-064E-4861-B59B-3D67F19F4E73}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_xplained168pb", "Projects\Optiboot_xplained168pb.cproj", "{4743E9BB-60C9-40C5-BE56-B3E6D46FE724}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_Curiosity4809", "Projects\Optiboot_Curiosity4809.cproj", "{6227EE60-D2C9-4F42-A423-6FC8100D656A}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_Xplained817", "Projects\Optiboot_Xplained817.cproj", "{0DACDF0F-4DFB-40BD-9C7A-8EB6ADD06DF8}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Optiboot_Curiosity3217", "Projects\Optiboot_Curiosity3217.cproj", "{4855869E-70EF-46C8-A56B-159D9DF9C08C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AVR = Debug|AVR
Release|AVR = Release|AVR
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
{1FCE634C-064E-4861-B59B-3D67F19F4E73}.Debug|AVR.ActiveCfg = Debug|AVR
{1FCE634C-064E-4861-B59B-3D67F19F4E73}.Debug|AVR.Build.0 = Debug|AVR
{1FCE634C-064E-4861-B59B-3D67F19F4E73}.Release|AVR.ActiveCfg = Release|AVR
{1FCE634C-064E-4861-B59B-3D67F19F4E73}.Release|AVR.Build.0 = Release|AVR
{4743E9BB-60C9-40C5-BE56-B3E6D46FE724}.Debug|AVR.ActiveCfg = Debug|AVR
{4743E9BB-60C9-40C5-BE56-B3E6D46FE724}.Debug|AVR.Build.0 = Debug|AVR
{4743E9BB-60C9-40C5-BE56-B3E6D46FE724}.Release|AVR.ActiveCfg = Release|AVR
{4743E9BB-60C9-40C5-BE56-B3E6D46FE724}.Release|AVR.Build.0 = Release|AVR
{6227EE60-D2C9-4F42-A423-6FC8100D656A}.Debug|AVR.ActiveCfg = Debug|AVR
{6227EE60-D2C9-4F42-A423-6FC8100D656A}.Debug|AVR.Build.0 = Debug|AVR
{6227EE60-D2C9-4F42-A423-6FC8100D656A}.Release|AVR.ActiveCfg = Release|AVR
{6227EE60-D2C9-4F42-A423-6FC8100D656A}.Release|AVR.Build.0 = Release|AVR
{0DACDF0F-4DFB-40BD-9C7A-8EB6ADD06DF8}.Debug|AVR.ActiveCfg = Debug|AVR
{0DACDF0F-4DFB-40BD-9C7A-8EB6ADD06DF8}.Debug|AVR.Build.0 = Debug|AVR
{0DACDF0F-4DFB-40BD-9C7A-8EB6ADD06DF8}.Release|AVR.ActiveCfg = Release|AVR
{0DACDF0F-4DFB-40BD-9C7A-8EB6ADD06DF8}.Release|AVR.Build.0 = Release|AVR
{4855869E-70EF-46C8-A56B-159D9DF9C08C}.Debug|AVR.ActiveCfg = Debug|AVR
{4855869E-70EF-46C8-A56B-159D9DF9C08C}.Debug|AVR.Build.0 = Debug|AVR
{4855869E-70EF-46C8-A56B-159D9DF9C08C}.Release|AVR.ActiveCfg = Release|AVR
{4855869E-70EF-46C8-A56B-159D9DF9C08C}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
86 changes: 86 additions & 0 deletions optiboot/AS7/Projects/Optiboot_Curiosity3217.componentinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
<ProjectComponents>
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
<CApiVersion></CApiVersion>
<CBundle></CBundle>
<CClass>Device</CClass>
<CGroup>Startup</CGroup>
<CSub></CSub>
<CVariant></CVariant>
<CVendor>Atmel</CVendor>
<CVersion>1.9.0</CVersion>
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<Description></Description>
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATtiny_DFP\1.9.337\include\</AbsolutePath>
<Attribute></Attribute>
<Category>include</Category>
<Condition>C</Condition>
<FileContentHash i:nil="true" />
<FileVersion></FileVersion>
<Name>include/</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATtiny_DFP\1.9.337\include\avr\iotn3217.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>2w4jXovAQpu2/KOPyxeSog==</FileContentHash>
<FileVersion></FileVersion>
<Name>include/avr/iotn3217.h</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATtiny_DFP\1.9.337\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>izQh6mt2zs6K/tWC7AU5ww==</FileContentHash>
<FileVersion></FileVersion>
<Name>templates/main.c</Name>
<SelectString>Main file (.c)</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATtiny_DFP\1.9.337\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</FileContentHash>
<FileVersion></FileVersion>
<Name>templates/main.cpp</Name>
<SelectString>Main file (.cpp)</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATtiny_DFP\1.9.337\gcc\dev\attiny3217</AbsolutePath>
<Attribute></Attribute>
<Category>libraryPrefix</Category>
<Condition>GCC</Condition>
<FileContentHash i:nil="true" />
<FileVersion></FileVersion>
<Name>gcc/dev/attiny3217</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
</Files>
<PackName>ATtiny_DFP</PackName>
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATtiny_DFP/1.9.337/Atmel.ATtiny_DFP.pdsc</PackPath>
<PackVersion>1.9.337</PackVersion>
<PresentInProject>true</PresentInProject>
<ReferenceConditionId>ATtiny3217</ReferenceConditionId>
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string></d4p1:string>
</RteComponents>
<Status>Resolved</Status>
<VersionMode>Fixed</VersionMode>
<IsComponentInAtProject>true</IsComponentInAtProject>
</ProjectComponent>
</ProjectComponents>
</Store>
134 changes: 134 additions & 0 deletions optiboot/AS7/Projects/Optiboot_Curiosity3217.cproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>7.0</ProjectVersion>
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
<ProjectGuid>{4855869e-70ef-46c8-a56b-159d9df9c08c}</ProjectGuid>
<avrdevice>ATtiny3217</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>Optiboot_Curiosity3217</AssemblyName>
<Name>Optiboot_Curiosity3217</Name>
<RootNamespace>Optiboot_Curiosity3217</RootNamespace>
<ToolchainFlavour>Native</ToolchainFlavour>
<KeepTimersRunning>true</KeepTimersRunning>
<OverrideVtor>false</OverrideVtor>
<CacheFlash>true</CacheFlash>
<ProgFlashFromRam>true</ProgFlashFromRam>
<RamSnippetAddress>0x20000000</RamSnippetAddress>
<UncachedRange />
<preserveEEPROM>true</preserveEEPROM>
<OverrideVtorValue>exception_table</OverrideVtorValue>
<BootSegment>2</BootSegment>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<avrtool>com.atmel.avrdbg.tool.simulator</avrtool>
<avrtoolserialnumber />
<avrdeviceexpectedsignature>0x1E9522</avrdeviceexpectedsignature>
<com_atmel_avrdbg_tool_simulator>
<ToolOptions>
<InterfaceProperties>
</InterfaceProperties>
<InterfaceName>
</InterfaceName>
</ToolOptions>
<ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
<ToolNumber>
</ToolNumber>
<ToolName>Simulator</ToolName>
</com_atmel_avrdbg_tool_simulator>
<avrtoolinterface />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=attiny3217 -B "%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\gcc\dev\attiny3217"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>NDEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\include\</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=attiny3217 -B "%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\gcc\dev\attiny3217"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\include\</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize debugging experience (-Og)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\Atmel\ATtiny_DFP\1.9.337\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
<UsesExternalMakeFile>True</UsesExternalMakeFile>
<OutputDirectory>$(MSBuildProjectDirectory)\..\..\bootloaders\optiboot</OutputDirectory>
<BuildTarget>optiboot_attiny3217.hex UARTTX=B2 TIMEOUT=8 LED=C0 BAUD_RATE=57600 PACKS="$(DEVICE_STARTUP_ROOT)"</BuildTarget>
<CleanTarget>clean</CleanTarget>
<ExternalMakeFilePath>..\..\bootloaders\optiboot\Makefile.mega0</ExternalMakeFilePath>
<PostBuildEvent>copy optiboot_attiny3217.elf $(MSBuildProjectName).elf
</PostBuildEvent>
</PropertyGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
</Project>
Loading

0 comments on commit c9bbfb2

Please sign in to comment.