tsb: slim the port branch to the libavr reimplementation
main carried the whole pre-libavr tree beside the port: the other-bootloader directories (blink, stk500v2), the Atmel Studio solution/project, and — dead in the tsb dir itself — four submodule links to the superseded io/flash/uart/type libraries the libavr sources never include. None are build inputs; CMake drives the three variants through FetchContent. master keeps the full legacy tree untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
27
.gitmodules
vendored
27
.gitmodules
vendored
@@ -1,27 +0,0 @@
|
|||||||
[submodule "tsb/io"]
|
|
||||||
path = tsb/io
|
|
||||||
url = git@git.blackmark.me:avr/io.git
|
|
||||||
[submodule "tsb/flash"]
|
|
||||||
path = tsb/flash
|
|
||||||
url = git@git.blackmark.me:avr/flash.git
|
|
||||||
[submodule "tsb/uart"]
|
|
||||||
path = tsb/uart
|
|
||||||
url = git@git.blackmark.me:avr/uart.git
|
|
||||||
[submodule "tsb/type"]
|
|
||||||
path = tsb/type
|
|
||||||
url = git@git.blackmark.me:avr/type.git
|
|
||||||
[submodule "stk500v2/type"]
|
|
||||||
path = stk500v2/type
|
|
||||||
url = git@git.blackmark.me:avr/type.git
|
|
||||||
[submodule "stk500v2/io"]
|
|
||||||
path = stk500v2/io
|
|
||||||
url = git@git.blackmark.me:avr/io.git
|
|
||||||
[submodule "stk500v2/uart"]
|
|
||||||
path = stk500v2/uart
|
|
||||||
url = git@git.blackmark.me:avr/uart.git
|
|
||||||
[submodule "stk500v2/flash"]
|
|
||||||
path = stk500v2/flash
|
|
||||||
url = git@git.blackmark.me:avr/flash.git
|
|
||||||
[submodule "blink/io"]
|
|
||||||
path = blink/io
|
|
||||||
url = git@git.blackmark.me:avr/io.git
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
<?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.CPP</ToolchainName>
|
|
||||||
<ProjectGuid>{d887fc8e-ee68-4248-8382-92dbc9a54145}</ProjectGuid>
|
|
||||||
<avrdevice>ATmega328P</avrdevice>
|
|
||||||
<avrdeviceseries>none</avrdeviceseries>
|
|
||||||
<OutputType>Executable</OutputType>
|
|
||||||
<Language>CPP</Language>
|
|
||||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
|
||||||
<OutputFileExtension>.elf</OutputFileExtension>
|
|
||||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
|
||||||
<AssemblyName>blink</AssemblyName>
|
|
||||||
<Name>blink</Name>
|
|
||||||
<RootNamespace>blink</RootNamespace>
|
|
||||||
<ToolchainFlavour>avr-g++-9.1.0</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.atmelice</avrtool>
|
|
||||||
<avrtoolserialnumber>J41800099437</avrtoolserialnumber>
|
|
||||||
<avrdeviceexpectedsignature>0x1E950F</avrdeviceexpectedsignature>
|
|
||||||
<com_atmel_avrdbg_tool_stk500>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.stk500</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>STK500</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_stk500>
|
|
||||||
<avrtoolinterface>ISP</avrtoolinterface>
|
|
||||||
<avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
|
|
||||||
<AsfFrameworkConfig>
|
|
||||||
<framework-data xmlns="">
|
|
||||||
<options />
|
|
||||||
<configurations />
|
|
||||||
<files />
|
|
||||||
<documentation help="" />
|
|
||||||
<offline-documentation help="" />
|
|
||||||
<dependencies>
|
|
||||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.47.0" />
|
|
||||||
</dependencies>
|
|
||||||
</framework-data>
|
|
||||||
</AsfFrameworkConfig>
|
|
||||||
<com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
|
||||||
<ToolNumber>J41800099437</ToolNumber>
|
|
||||||
<ToolName>Atmel-ICE</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<custom>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>custom</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>Custom Programming Tool</ToolName>
|
|
||||||
</custom>
|
|
||||||
<com_atmel_avrdbg_tool_simulator>
|
|
||||||
<ToolOptions xmlns="">
|
|
||||||
<InterfaceProperties>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
|
|
||||||
<ToolNumber xmlns="">
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName xmlns="">Simulator</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_simulator>
|
|
||||||
<AAFDebugger>
|
|
||||||
<AAFDebugFiles>
|
|
||||||
</AAFDebugFiles>
|
|
||||||
</AAFDebugger>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega328p</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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>NDEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega328p</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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcc.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>DEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize (-O1)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcccpp.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="bootloader.cpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="bootloader.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="clock.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="io\io.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="main.cpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="io" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
|
||||||
</Project>
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#include "bootloader.hpp"
|
|
||||||
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#include <avr/wdt.h>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
typedef void (*jmp_fn)() __attribute__((noreturn));
|
|
||||||
|
|
||||||
jmp_fn boot = reinterpret_cast<jmp_fn>(0x0000);
|
|
||||||
jmp_fn bootloader = reinterpret_cast<jmp_fn>(0x7800 / 2);
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
bool Bootloader::handleReset()
|
|
||||||
{
|
|
||||||
wdt_reset();
|
|
||||||
uint8_t mcuStatus = MCUSR;
|
|
||||||
MCUSR &= ~(1 << WDRF);
|
|
||||||
wdt_disable();
|
|
||||||
return (mcuStatus & (1 << WDRF));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bootloader::reset()
|
|
||||||
{
|
|
||||||
wdt_enable(WDTO_15MS);
|
|
||||||
while (true)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bootloader::check()
|
|
||||||
{
|
|
||||||
if (pgm_read_byte(reinterpret_cast<uint16_t>(bootloader) * 2) != 0xFF)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bootloader::call()
|
|
||||||
{
|
|
||||||
if (check())
|
|
||||||
bootloader();
|
|
||||||
else
|
|
||||||
boot();
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
class Bootloader {
|
|
||||||
public:
|
|
||||||
template <typename Fn>
|
|
||||||
static inline void init(Fn callback)
|
|
||||||
{
|
|
||||||
if (handleReset()) {
|
|
||||||
callback();
|
|
||||||
call();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void enter()
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static bool handleReset();
|
|
||||||
static void reset();
|
|
||||||
static bool check();
|
|
||||||
static void call();
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#define F_CPU 18'432'000
|
|
||||||
#define F_CPU 16'000'000
|
|
||||||
#include <util/delay.h>
|
|
||||||
1
blink/io
1
blink/io
Submodule blink/io deleted from 80de36ee7e
@@ -1,30 +0,0 @@
|
|||||||
#include "clock.hpp"
|
|
||||||
|
|
||||||
#include "io/io.hpp"
|
|
||||||
|
|
||||||
#include "bootloader.hpp"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
io::Pin<io::P::B5> ledPin;
|
|
||||||
ledPin.dir(io::Dir::OUT);
|
|
||||||
ledPin = false;
|
|
||||||
|
|
||||||
Bootloader::init([&ledPin]() {
|
|
||||||
for (uint8_t i = 0; i < 10; ++i) {
|
|
||||||
ledPin = true;
|
|
||||||
_delay_ms(50);
|
|
||||||
ledPin = false;
|
|
||||||
_delay_ms(50);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 10; ++i) {
|
|
||||||
ledPin.toggle();
|
|
||||||
_delay_ms(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bootloader::enter();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
|
|
||||||
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("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "tsb", "tsb\tsb.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
|
|
||||||
EndProject
|
|
||||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "stk500v2", "stk500v2\stk500v2.cppproj", "{19798CCE-5D96-40E9-B769-D209715DCE0C}"
|
|
||||||
EndProject
|
|
||||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "blink", "blink\blink.cppproj", "{D887FC8E-EE68-4248-8382-92DBC9A54145}"
|
|
||||||
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
|
|
||||||
{19798CCE-5D96-40E9-B769-D209715DCE0C}.Debug|AVR.ActiveCfg = Debug|AVR
|
|
||||||
{19798CCE-5D96-40E9-B769-D209715DCE0C}.Debug|AVR.Build.0 = Debug|AVR
|
|
||||||
{19798CCE-5D96-40E9-B769-D209715DCE0C}.Release|AVR.ActiveCfg = Release|AVR
|
|
||||||
{19798CCE-5D96-40E9-B769-D209715DCE0C}.Release|AVR.Build.0 = Release|AVR
|
|
||||||
{D887FC8E-EE68-4248-8382-92DBC9A54145}.Debug|AVR.ActiveCfg = Debug|AVR
|
|
||||||
{D887FC8E-EE68-4248-8382-92DBC9A54145}.Debug|AVR.Build.0 = Debug|AVR
|
|
||||||
{D887FC8E-EE68-4248-8382-92DBC9A54145}.Release|AVR.ActiveCfg = Release|AVR
|
|
||||||
{D887FC8E-EE68-4248-8382-92DBC9A54145}.Release|AVR.Build.0 = Release|AVR
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#define F_CPU 18'432'000
|
|
||||||
#define F_CPU 16'000'000
|
|
||||||
#include <util/delay.h>
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK message constants
|
|
||||||
|
|
||||||
static constexpr uint8_t MESSAGE_START = 0x1B; // ASCII ESC
|
|
||||||
static constexpr uint8_t TOKEN = 0x0E;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK general command constants
|
|
||||||
|
|
||||||
static constexpr uint8_t CMD_SIGN_ON = 0x01;
|
|
||||||
static constexpr uint8_t CMD_SET_PARAMETER = 0x02;
|
|
||||||
static constexpr uint8_t CMD_GET_PARAMETER = 0x03;
|
|
||||||
static constexpr uint8_t CMD_SET_DEVICE_PARAMETERS = 0x04;
|
|
||||||
static constexpr uint8_t CMD_OSCCAL = 0x05;
|
|
||||||
static constexpr uint8_t CMD_LOAD_ADDRESS = 0x06;
|
|
||||||
static constexpr uint8_t CMD_FIRMWARE_UPGRADE = 0x07;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK ISP command constants
|
|
||||||
|
|
||||||
static constexpr uint8_t CMD_ENTER_PROGMODE_ISP = 0x10;
|
|
||||||
static constexpr uint8_t CMD_LEAVE_PROGMODE_ISP = 0x11;
|
|
||||||
static constexpr uint8_t CMD_CHIP_ERASE_ISP = 0x12;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FLASH_ISP = 0x13;
|
|
||||||
static constexpr uint8_t CMD_READ_FLASH_ISP = 0x14;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_EEPROM_ISP = 0x15;
|
|
||||||
static constexpr uint8_t CMD_READ_EEPROM_ISP = 0x16;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FUSE_ISP = 0x17;
|
|
||||||
static constexpr uint8_t CMD_READ_FUSE_ISP = 0x18;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_LOCK_ISP = 0x19;
|
|
||||||
static constexpr uint8_t CMD_READ_LOCK_ISP = 0x1A;
|
|
||||||
static constexpr uint8_t CMD_READ_SIGNATURE_ISP = 0x1B;
|
|
||||||
static constexpr uint8_t CMD_READ_OSCCAL_ISP = 0x1C;
|
|
||||||
static constexpr uint8_t CMD_SPI_MULTI = 0x1D;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK PP command constants
|
|
||||||
|
|
||||||
static constexpr uint8_t CMD_ENTER_PROGMODE_PP = 0x20;
|
|
||||||
static constexpr uint8_t CMD_LEAVE_PROGMODE_PP = 0x21;
|
|
||||||
static constexpr uint8_t CMD_CHIP_ERASE_PP = 0x22;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FLASH_PP = 0x23;
|
|
||||||
static constexpr uint8_t CMD_READ_FLASH_PP = 0x24;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_EEPROM_PP = 0x25;
|
|
||||||
static constexpr uint8_t CMD_READ_EEPROM_PP = 0x26;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FUSE_PP = 0x27;
|
|
||||||
static constexpr uint8_t CMD_READ_FUSE_PP = 0x28;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_LOCK_PP = 0x29;
|
|
||||||
static constexpr uint8_t CMD_READ_LOCK_PP = 0x2A;
|
|
||||||
static constexpr uint8_t CMD_READ_SIGNATURE_PP = 0x2B;
|
|
||||||
static constexpr uint8_t CMD_READ_OSCCAL_PP = 0x2C;
|
|
||||||
|
|
||||||
static constexpr uint8_t CMD_SET_CONTROL_STACK = 0x2D;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK HVSP command constants
|
|
||||||
|
|
||||||
static constexpr uint8_t CMD_ENTER_PROGMODE_HVSP = 0x30;
|
|
||||||
static constexpr uint8_t CMD_LEAVE_PROGMODE_HVSP = 0x31;
|
|
||||||
static constexpr uint8_t CMD_CHIP_ERASE_HVSP = 0x32;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FLASH_HVSP = 0x33;
|
|
||||||
static constexpr uint8_t CMD_READ_FLASH_HVSP = 0x34;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_EEPROM_HVSP = 0x35;
|
|
||||||
static constexpr uint8_t CMD_READ_EEPROM_HVSP = 0x36;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_FUSE_HVSP = 0x37;
|
|
||||||
static constexpr uint8_t CMD_READ_FUSE_HVSP = 0x38;
|
|
||||||
static constexpr uint8_t CMD_PROGRAM_LOCK_HVSP = 0x39;
|
|
||||||
static constexpr uint8_t CMD_READ_LOCK_HVSP = 0x3A;
|
|
||||||
static constexpr uint8_t CMD_READ_SIGNATURE_HVSP = 0x3B;
|
|
||||||
static constexpr uint8_t CMD_READ_OSCCAL_HVSP = 0x3C;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK status constants
|
|
||||||
|
|
||||||
// Success
|
|
||||||
static constexpr uint8_t STATUS_CMD_OK = 0x00;
|
|
||||||
|
|
||||||
// Warnings
|
|
||||||
static constexpr uint8_t STATUS_CMD_TOUT = 0x80;
|
|
||||||
static constexpr uint8_t STATUS_RDY_BSY_TOUT = 0x81;
|
|
||||||
static constexpr uint8_t STATUS_SET_PARAM_MISSING = 0x82;
|
|
||||||
|
|
||||||
// Errors
|
|
||||||
static constexpr uint8_t STATUS_CMD_FAILED = 0xC0;
|
|
||||||
static constexpr uint8_t STATUS_CKSUM_ERROR = 0xC1;
|
|
||||||
static constexpr uint8_t STATUS_CMD_UNKNOWN = 0xC9;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK parameter constants
|
|
||||||
static constexpr uint8_t PARAM_BUILD_NUMBER_LOW = 0x80;
|
|
||||||
static constexpr uint8_t PARAM_BUILD_NUMBER_HIGH = 0x81;
|
|
||||||
static constexpr uint8_t PARAM_HW_VER = 0x90;
|
|
||||||
static constexpr uint8_t PARAM_SW_MAJOR = 0x91;
|
|
||||||
static constexpr uint8_t PARAM_SW_MINOR = 0x92;
|
|
||||||
static constexpr uint8_t PARAM_VTARGET = 0x94;
|
|
||||||
static constexpr uint8_t PARAM_VADJUST = 0x95;
|
|
||||||
static constexpr uint8_t PARAM_OSC_PSCALE = 0x96;
|
|
||||||
static constexpr uint8_t PARAM_OSC_CMATCH = 0x97;
|
|
||||||
static constexpr uint8_t PARAM_SCK_DURATION = 0x98;
|
|
||||||
static constexpr uint8_t PARAM_TOPCARD_DETECT = 0x9A;
|
|
||||||
static constexpr uint8_t PARAM_STATUS = 0x9C;
|
|
||||||
static constexpr uint8_t PARAM_DATA = 0x9D;
|
|
||||||
static constexpr uint8_t PARAM_RESET_POLARITY = 0x9E;
|
|
||||||
static constexpr uint8_t PARAM_CONTROLLER_INIT = 0x9F;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// STK answer constants
|
|
||||||
|
|
||||||
static constexpr uint8_t ANSWER_CKSUM_ERROR = 0xB0;
|
|
||||||
Submodule stk500v2/flash deleted from 6edb2e5a21
Submodule stk500v2/io deleted from 80de36ee7e
@@ -1,611 +0,0 @@
|
|||||||
#include "clock.hpp"
|
|
||||||
|
|
||||||
#include "uart/uart.hpp"
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include <avr/boot.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
|
|
||||||
#include "command.hpp"
|
|
||||||
|
|
||||||
static constexpr auto TIMEOUT = 5000;
|
|
||||||
static constexpr auto BAUD_RATE = 115200;
|
|
||||||
|
|
||||||
using uart_interface = uart::Hardware0<uart::Config<BAUD_RATE>, uart::Driven::BLOCKING>;
|
|
||||||
uart::Uart<uart_interface> serial;
|
|
||||||
|
|
||||||
struct Message {
|
|
||||||
uint8_t start;
|
|
||||||
uint8_t number;
|
|
||||||
uint16_t size;
|
|
||||||
uint8_t token;
|
|
||||||
uint8_t body[275];
|
|
||||||
uint8_t checksum;
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline bool receiveByte(uint8_t &data, uint16_t &timeout)
|
|
||||||
{
|
|
||||||
constexpr auto MICROSECOND = 1000.0 * 1000;
|
|
||||||
constexpr auto SYMBOL_SIZE = 9;
|
|
||||||
constexpr auto BYTE_DELAY_US = (SYMBOL_SIZE * MICROSECOND) / BAUD_RATE;
|
|
||||||
constexpr auto NUM_MS_DELAY_STEPS = static_cast<uint16_t>(round(1000 / BYTE_DELAY_US));
|
|
||||||
uint16_t msDelay = NUM_MS_DELAY_STEPS;
|
|
||||||
|
|
||||||
while (timeout) {
|
|
||||||
if (serial.rxByte(data)) {
|
|
||||||
timeout = TIMEOUT;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_delay_us(BYTE_DELAY_US);
|
|
||||||
|
|
||||||
if (--msDelay == 0) {
|
|
||||||
msDelay = NUM_MS_DELAY_STEPS;
|
|
||||||
--timeout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint8_t calcChecksum(const Message &msg)
|
|
||||||
{
|
|
||||||
uint8_t checksum = msg.start;
|
|
||||||
|
|
||||||
for (uint16_t i = 1; i < 5 + msg.size; ++i) {
|
|
||||||
checksum ^= *(reinterpret_cast<const uint8_t *>(&msg) + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return checksum;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool receiveMessage(Message &msg, uint16_t &timeout)
|
|
||||||
{
|
|
||||||
if (!receiveByte(msg.start, timeout) || msg.start != MESSAGE_START)
|
|
||||||
return false;
|
|
||||||
if (!receiveByte(msg.number, timeout))
|
|
||||||
return false;
|
|
||||||
if (!receiveByte(*(reinterpret_cast<uint8_t *>(&msg.size) + 1), timeout))
|
|
||||||
return false;
|
|
||||||
if (!receiveByte(*reinterpret_cast<uint8_t *>(&msg.size), timeout) || msg.size > sizeof(msg.body))
|
|
||||||
return false;
|
|
||||||
if (!receiveByte(msg.token, timeout) || msg.token != TOKEN)
|
|
||||||
return false;
|
|
||||||
for (uint16_t i = 0; i < msg.size; ++i) {
|
|
||||||
if (!receiveByte(msg.body[i], timeout))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!receiveByte(msg.checksum, timeout) || msg.checksum != calcChecksum(msg))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void transmitMessage(const Message &msg)
|
|
||||||
{
|
|
||||||
serial.txByte(msg.start);
|
|
||||||
serial.txByte(msg.number);
|
|
||||||
serial.txByte(msg.size >> 8);
|
|
||||||
serial.txByte(msg.size & 0xFF);
|
|
||||||
serial.txByte(msg.token);
|
|
||||||
for (uint16_t i = 0; i < msg.size; ++i)
|
|
||||||
serial.txByte(msg.body[i]);
|
|
||||||
serial.txByte(msg.checksum);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isSignOn(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 1 && msg.body[0] == CMD_SIGN_ON)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isGetParameter(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 2 && msg.body[0] == CMD_GET_PARAMETER)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isSetParameter(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 3 && msg.body[0] == CMD_SET_PARAMETER)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isEnterProgmodeIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 12 && msg.body[0] == CMD_ENTER_PROGMODE_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isReadSignatureIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 6 && msg.body[0] == CMD_READ_SIGNATURE_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isReadFuseIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 6 && msg.body[0] == CMD_READ_FUSE_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isReadLockIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 6 && msg.body[0] == CMD_READ_LOCK_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isLoadAddress(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 5 && msg.body[0] == CMD_LOAD_ADDRESS)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isReadFlashIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 4 && msg.body[0] == CMD_READ_FLASH_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isReadEepromIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 4 && msg.body[0] == CMD_READ_EEPROM_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isChipEraseIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 7 && msg.body[0] == CMD_CHIP_ERASE_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isProgramFlashIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.body[0] == CMD_PROGRAM_FLASH_ISP) {
|
|
||||||
const auto dataSize = static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2];
|
|
||||||
if (msg.size == (dataSize + 10) && dataSize == SPM_PAGESIZE)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isProgramEepromIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.body[0] == CMD_PROGRAM_EEPROM_ISP) {
|
|
||||||
if (msg.size == (static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2]) + 10)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isLeaveProgmodeIsp(const Message &msg)
|
|
||||||
{
|
|
||||||
if (msg.size == 3 && msg.body[0] == CMD_LEAVE_PROGMODE_ISP)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatSignOnAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 3 + 8;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
msg.body[2] = 8;
|
|
||||||
msg.body[3] = 'S';
|
|
||||||
msg.body[4] = 'T';
|
|
||||||
msg.body[5] = 'K';
|
|
||||||
msg.body[6] = '5';
|
|
||||||
msg.body[7] = '0';
|
|
||||||
msg.body[8] = '0';
|
|
||||||
msg.body[9] = '_';
|
|
||||||
msg.body[10] = '2';
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatGetParameterAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 3;
|
|
||||||
|
|
||||||
if (msg.body[1] == PARAM_HW_VER) {
|
|
||||||
msg.body[2] = 1;
|
|
||||||
} else if (msg.body[1] == PARAM_SW_MAJOR) {
|
|
||||||
msg.body[2] = 0x02;
|
|
||||||
} else if (msg.body[1] == PARAM_SW_MINOR) {
|
|
||||||
msg.body[2] = 0x0a;
|
|
||||||
} else if (msg.body[1] == PARAM_SCK_DURATION) {
|
|
||||||
msg.body[2] = 2;
|
|
||||||
} else if (msg.body[1] == PARAM_VADJUST) {
|
|
||||||
msg.body[2] = 25;
|
|
||||||
} else if (msg.body[1] == PARAM_VTARGET) {
|
|
||||||
msg.body[2] = 49;
|
|
||||||
} else if (msg.body[1] == PARAM_OSC_PSCALE) {
|
|
||||||
msg.body[2] = 2;
|
|
||||||
} else if (msg.body[1] == PARAM_OSC_CMATCH) {
|
|
||||||
msg.body[2] = 127;
|
|
||||||
} else if (msg.body[1] == PARAM_TOPCARD_DETECT) {
|
|
||||||
msg.body[2] = 0xFF;
|
|
||||||
} else {
|
|
||||||
msg.size = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg.size == 2) {
|
|
||||||
msg.body[1] = STATUS_CMD_FAILED;
|
|
||||||
} else {
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatSetParameterAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatEnterProgmodeIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatReadSignatureIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 4;
|
|
||||||
msg.body[2] = boot_signature_byte_get(msg.body[4] * 2);
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
msg.body[3] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatReadFuseIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
constexpr auto READ_LOW_FUSE_BITS = 0x0050;
|
|
||||||
constexpr auto READ_HIGH_FUSE_BITS = 0x0858;
|
|
||||||
constexpr auto READ_EXTENDED_FUSE_BITS = 0x0850;
|
|
||||||
|
|
||||||
msg.size = 4;
|
|
||||||
|
|
||||||
if (*reinterpret_cast<uint16_t *>(msg.body + 2) == READ_EXTENDED_FUSE_BITS) {
|
|
||||||
msg.body[2] = boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS);
|
|
||||||
}
|
|
||||||
if (*reinterpret_cast<uint16_t *>(msg.body + 2) == READ_HIGH_FUSE_BITS) {
|
|
||||||
msg.body[2] = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
|
|
||||||
}
|
|
||||||
if (*reinterpret_cast<uint16_t *>(msg.body + 2) == READ_LOW_FUSE_BITS) {
|
|
||||||
msg.body[2] = boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS);
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
msg.body[3] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatReadLockIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 4;
|
|
||||||
msg.body[2] = boot_lock_fuse_bits_get(GET_LOCK_BITS);
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
msg.body[3] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatLoadAddressAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatReadFlashIspAnswer(Message &msg, uint32_t &addr)
|
|
||||||
{
|
|
||||||
const uint16_t byteAddress = 2 * addr;
|
|
||||||
const uint16_t numBytes = static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2];
|
|
||||||
msg.size = 3 + numBytes;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
for (uint16_t i = 0; i < numBytes; ++i) {
|
|
||||||
msg.body[i + 2] = pgm_read_byte(static_cast<uint16_t>(byteAddress + i));
|
|
||||||
}
|
|
||||||
const auto numWords = numBytes / 2;
|
|
||||||
addr += numWords;
|
|
||||||
msg.body[numBytes + 2] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
bool isEepromReady()
|
|
||||||
{
|
|
||||||
return (EECR & (1 << EEPE)) ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void waitEepromReady()
|
|
||||||
{
|
|
||||||
while (!isEepromReady())
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t readEepromByte(const uint8_t *addr)
|
|
||||||
{
|
|
||||||
EEAR = reinterpret_cast<uint16_t>(addr);
|
|
||||||
EECR |= (1 << EERE);
|
|
||||||
return EEDR;
|
|
||||||
}
|
|
||||||
|
|
||||||
void writeEepromByte(uint8_t *addr, uint8_t value)
|
|
||||||
{
|
|
||||||
EECR = 0;
|
|
||||||
EEAR = reinterpret_cast<uint16_t>(addr);
|
|
||||||
EEDR = value;
|
|
||||||
EECR |= (1 << EEMPE);
|
|
||||||
EECR |= (1 << EEPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void writeFlashPage(uint32_t pageAddress, const uint8_t *data)
|
|
||||||
{
|
|
||||||
boot_page_erase(pageAddress);
|
|
||||||
boot_spm_busy_wait();
|
|
||||||
|
|
||||||
for (uint16_t i = 0; i < SPM_PAGESIZE; i += 2) {
|
|
||||||
uint16_t dataWord = *data++;
|
|
||||||
dataWord |= (*data++) << 8;
|
|
||||||
boot_page_fill(pageAddress + i, dataWord);
|
|
||||||
}
|
|
||||||
|
|
||||||
boot_page_write(pageAddress);
|
|
||||||
boot_spm_busy_wait();
|
|
||||||
boot_rww_enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
static inline uint16_t getBootloaderSize()
|
|
||||||
{
|
|
||||||
const auto highFuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
|
|
||||||
constexpr auto BOOTSZ0 = 1;
|
|
||||||
constexpr auto BOOTSZ1 = 2;
|
|
||||||
|
|
||||||
if (highFuse & (1 << BOOTSZ1) && highFuse & (1 << BOOTSZ0))
|
|
||||||
return 256 * 2;
|
|
||||||
else if (highFuse & (1 << BOOTSZ1))
|
|
||||||
return 512 * 2;
|
|
||||||
else if (highFuse & (1 << BOOTSZ0))
|
|
||||||
return 1024 * 2;
|
|
||||||
return 2048 * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t getFlashSize()
|
|
||||||
{
|
|
||||||
const auto bootloaderSize = getBootloaderSize();
|
|
||||||
return (FLASHEND - bootloaderSize + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void performChipErase(uint16_t flashStartAddress = 0x0000)
|
|
||||||
{
|
|
||||||
constexpr auto getEepromEraseFuseBit = []() -> bool {
|
|
||||||
constexpr auto EESAVE = 3;
|
|
||||||
return boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS) & (1 << EESAVE);
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr auto eraseFlash = [](const uint16_t &flashStartAddress) {
|
|
||||||
const auto flashSize = getFlashSize();
|
|
||||||
const auto byteAddress = 2 * flashStartAddress;
|
|
||||||
for (uint16_t i = byteAddress; i < flashSize; i += SPM_PAGESIZE) {
|
|
||||||
boot_page_erase(i);
|
|
||||||
boot_spm_busy_wait();
|
|
||||||
}
|
|
||||||
boot_rww_enable();
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr auto eraseEeprom = [getEepromEraseFuseBit]() {
|
|
||||||
const auto eraseEeprom = getEepromEraseFuseBit();
|
|
||||||
if (eraseEeprom) {
|
|
||||||
constexpr auto EEPROM_SIZE = E2END + 1;
|
|
||||||
for (uint16_t i = 0; i < EEPROM_SIZE; ++i) {
|
|
||||||
writeEepromByte(reinterpret_cast<uint8_t *>(i), 0xFF);
|
|
||||||
waitEepromReady();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
eraseFlash(flashStartAddress);
|
|
||||||
eraseEeprom();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatChipEraseIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatReadEepromIspAnswer(Message &msg, uint32_t &addr)
|
|
||||||
{
|
|
||||||
const uint16_t numBytes = static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2];
|
|
||||||
msg.size = 3 + numBytes;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
for (uint16_t i = 0; i < numBytes; ++i) {
|
|
||||||
msg.body[i + 2] = readEepromByte(reinterpret_cast<const uint8_t *>(addr + i));
|
|
||||||
}
|
|
||||||
addr += numBytes;
|
|
||||||
msg.body[numBytes + 2] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatProgramFlashIspAnswer(Message &msg, uint32_t &addr)
|
|
||||||
{
|
|
||||||
const auto byteAddress = 2 * addr;
|
|
||||||
if (byteAddress < getFlashSize())
|
|
||||||
writeFlashPage(byteAddress, msg.body + 10);
|
|
||||||
const uint16_t numBytes = static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2];
|
|
||||||
const auto numWords = numBytes / 2;
|
|
||||||
addr += numWords;
|
|
||||||
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatProgramEepromIspAnswer(Message &msg, uint32_t &addr)
|
|
||||||
{
|
|
||||||
const uint16_t numBytes = static_cast<uint16_t>(msg.body[1]) << 8 | msg.body[2];
|
|
||||||
for (uint16_t i = 0; i < numBytes; ++i) {
|
|
||||||
writeEepromByte(reinterpret_cast<uint8_t *>(addr + i), msg.body[10 + i]);
|
|
||||||
waitEepromReady();
|
|
||||||
}
|
|
||||||
addr += numBytes;
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatLeaveProgmodeIspAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.size = 2;
|
|
||||||
msg.body[1] = STATUS_CMD_OK;
|
|
||||||
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void formatErrorAnswer(Message &msg)
|
|
||||||
{
|
|
||||||
msg.start = MESSAGE_START;
|
|
||||||
msg.size = 1;
|
|
||||||
msg.token = TOKEN;
|
|
||||||
msg.body[0] = STATUS_CMD_UNKNOWN;
|
|
||||||
msg.checksum = calcChecksum(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class ChipEraseState {
|
|
||||||
NONE = 0,
|
|
||||||
REQUEST = (1 << 1),
|
|
||||||
RESPONSE = (1 << 2),
|
|
||||||
PERFORM = REQUEST | RESPONSE,
|
|
||||||
PROGRAM = (1 << 3),
|
|
||||||
FINISH = REQUEST | RESPONSE | PROGRAM,
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr ChipEraseState operator|(const ChipEraseState &self, const ChipEraseState &other)
|
|
||||||
{
|
|
||||||
return static_cast<ChipEraseState>(static_cast<uint8_t>(self) | static_cast<uint8_t>(other));
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr ChipEraseState &operator|=(ChipEraseState &self, const ChipEraseState &other)
|
|
||||||
{
|
|
||||||
self = self | other;
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void handleMessage(Message &msg, uint32_t &addr, uint16_t &finishEraseAddress,
|
|
||||||
ChipEraseState &chipEraseFlag)
|
|
||||||
{
|
|
||||||
if (isSignOn(msg))
|
|
||||||
formatSignOnAnswer(msg);
|
|
||||||
else if (isGetParameter(msg))
|
|
||||||
formatGetParameterAnswer(msg);
|
|
||||||
else if (isSetParameter(msg))
|
|
||||||
formatSetParameterAnswer(msg);
|
|
||||||
else if (isEnterProgmodeIsp(msg))
|
|
||||||
formatEnterProgmodeIspAnswer(msg);
|
|
||||||
else if (isReadSignatureIsp(msg))
|
|
||||||
formatReadSignatureIspAnswer(msg);
|
|
||||||
else if (isReadFuseIsp(msg))
|
|
||||||
formatReadFuseIspAnswer(msg);
|
|
||||||
else if (isReadLockIsp(msg))
|
|
||||||
formatReadLockIspAnswer(msg);
|
|
||||||
else if (isLoadAddress(msg)) {
|
|
||||||
addr = msg.body[1];
|
|
||||||
addr = (addr << 8) | msg.body[2];
|
|
||||||
addr = (addr << 8) | msg.body[3];
|
|
||||||
addr = (addr << 8) | msg.body[4];
|
|
||||||
formatLoadAddressAnswer(msg);
|
|
||||||
} else if (isReadFlashIsp(msg))
|
|
||||||
formatReadFlashIspAnswer(msg, addr);
|
|
||||||
else if (isReadEepromIsp(msg))
|
|
||||||
formatReadEepromIspAnswer(msg, addr);
|
|
||||||
else if (isChipEraseIsp(msg)) {
|
|
||||||
chipEraseFlag |= ChipEraseState::REQUEST;
|
|
||||||
formatChipEraseIspAnswer(msg);
|
|
||||||
} else if (isProgramFlashIsp(msg)) {
|
|
||||||
chipEraseFlag |= ChipEraseState::PROGRAM;
|
|
||||||
formatProgramFlashIspAnswer(msg, addr);
|
|
||||||
finishEraseAddress = addr;
|
|
||||||
} else if (isProgramEepromIsp(msg))
|
|
||||||
formatProgramEepromIspAnswer(msg, addr);
|
|
||||||
else if (isLeaveProgmodeIsp(msg)) {
|
|
||||||
chipEraseFlag |= ChipEraseState::RESPONSE;
|
|
||||||
formatLeaveProgmodeIspAnswer(msg);
|
|
||||||
} else
|
|
||||||
formatErrorAnswer(msg);
|
|
||||||
|
|
||||||
transmitMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
serial.init();
|
|
||||||
|
|
||||||
Message msg;
|
|
||||||
uint32_t addr = 0x0000;
|
|
||||||
uint16_t finishEraseAddress = 0x0000;
|
|
||||||
ChipEraseState chipEraseFlag = ChipEraseState::NONE;
|
|
||||||
uint16_t timeout = TIMEOUT;
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
if (receiveMessage(msg, timeout)) {
|
|
||||||
handleMessage(msg, addr, finishEraseAddress, chipEraseFlag);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timeout == 0) {
|
|
||||||
if (chipEraseFlag == ChipEraseState::PERFORM) {
|
|
||||||
performChipErase();
|
|
||||||
chipEraseFlag = ChipEraseState::NONE;
|
|
||||||
} else if (chipEraseFlag == ChipEraseState::FINISH) {
|
|
||||||
performChipErase(finishEraseAddress);
|
|
||||||
chipEraseFlag = ChipEraseState::NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
asm volatile("jmp 0x0000");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void startup() __attribute__((naked, section(".vectors")));
|
|
||||||
void startup()
|
|
||||||
{
|
|
||||||
asm volatile("clr __zero_reg__");
|
|
||||||
SP = RAMEND;
|
|
||||||
SREG = 0;
|
|
||||||
asm volatile("jmp main");
|
|
||||||
}
|
|
||||||
@@ -1,275 +0,0 @@
|
|||||||
<?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.CPP</ToolchainName>
|
|
||||||
<ProjectGuid>{19798cce-5d96-40e9-b769-d209715dce0c}</ProjectGuid>
|
|
||||||
<avrdevice>ATmega328P</avrdevice>
|
|
||||||
<avrdeviceseries>none</avrdeviceseries>
|
|
||||||
<OutputType>Executable</OutputType>
|
|
||||||
<Language>CPP</Language>
|
|
||||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
|
||||||
<OutputFileExtension>.elf</OutputFileExtension>
|
|
||||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
|
||||||
<AssemblyName>stk500v2</AssemblyName>
|
|
||||||
<Name>stk500v2</Name>
|
|
||||||
<RootNamespace>stk500v2</RootNamespace>
|
|
||||||
<ToolchainFlavour>avr-g++-9.1.0</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.atmelice</avrtool>
|
|
||||||
<avrtoolserialnumber>J41800099437</avrtoolserialnumber>
|
|
||||||
<avrdeviceexpectedsignature>0x1E950F</avrdeviceexpectedsignature>
|
|
||||||
<com_atmel_avrdbg_tool_stk500>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.stk500</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>STK500</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_stk500>
|
|
||||||
<avrtoolinterface>ISP</avrtoolinterface>
|
|
||||||
<avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
|
|
||||||
<AsfFrameworkConfig>
|
|
||||||
<framework-data xmlns="">
|
|
||||||
<options />
|
|
||||||
<configurations />
|
|
||||||
<files />
|
|
||||||
<documentation help="" />
|
|
||||||
<offline-documentation help="" />
|
|
||||||
<dependencies>
|
|
||||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.47.0" />
|
|
||||||
</dependencies>
|
|
||||||
</framework-data>
|
|
||||||
</AsfFrameworkConfig>
|
|
||||||
<com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
|
||||||
<ToolNumber>J41800099437</ToolNumber>
|
|
||||||
<ToolName>Atmel-ICE</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<custom>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>custom</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>Custom Programming Tool</ToolName>
|
|
||||||
</custom>
|
|
||||||
<com_atmel_avrdbg_tool_simulator>
|
|
||||||
<ToolOptions xmlns="">
|
|
||||||
<InterfaceProperties>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
|
|
||||||
<ToolNumber xmlns="">
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName xmlns="">Simulator</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_simulator>
|
|
||||||
<AAFDebugger>
|
|
||||||
<AAFDebugFiles>
|
|
||||||
</AAFDebugFiles>
|
|
||||||
</AAFDebugger>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega328p</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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>NDEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.general.NoStartupOrDefaultLibs>True</avrgcccpp.linker.general.NoStartupOrDefaultLibs>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.linker.memorysettings.Flash>
|
|
||||||
<ListValues>
|
|
||||||
<Value>.text=0x3C00</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.memorysettings.Flash>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega328p</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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcc.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>DEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize debugging experience (-Og)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcccpp.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.general.NoStartupOrDefaultLibs>True</avrgcccpp.linker.general.NoStartupOrDefaultLibs>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.linker.memorysettings.Flash>
|
|
||||||
<ListValues>
|
|
||||||
<Value>.text=0x3800</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.memorysettings.Flash>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="clock.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="command.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="flash\flash.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="io\io.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="main.cpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="type\type.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\config.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware0.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware1.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\software.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\uart.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="flash" />
|
|
||||||
<Folder Include="io" />
|
|
||||||
<Folder Include="uart" />
|
|
||||||
<Folder Include="type" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
|
||||||
</Project>
|
|
||||||
Submodule stk500v2/type deleted from ce31ef017f
Submodule stk500v2/uart deleted from 8f88cdccea
@@ -1,4 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define F_CPU 18'432'000
|
|
||||||
#include <util/delay.h>
|
|
||||||
Submodule tsb/flash deleted from 6edb2e5a21
1
tsb/io
1
tsb/io
Submodule tsb/io deleted from 80de36ee7e
263
tsb/tsb.cppproj
263
tsb/tsb.cppproj
@@ -1,263 +0,0 @@
|
|||||||
<?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.CPP</ToolchainName>
|
|
||||||
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
|
|
||||||
<avrdevice>ATmega328P</avrdevice>
|
|
||||||
<avrdeviceseries>none</avrdeviceseries>
|
|
||||||
<OutputType>Executable</OutputType>
|
|
||||||
<Language>CPP</Language>
|
|
||||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
|
||||||
<OutputFileExtension>.elf</OutputFileExtension>
|
|
||||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
|
||||||
<AssemblyName>tsb</AssemblyName>
|
|
||||||
<Name>tsb</Name>
|
|
||||||
<RootNamespace>tsb</RootNamespace>
|
|
||||||
<ToolchainFlavour>avr-g++-9.1.0</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>
|
|
||||||
</avrtool>
|
|
||||||
<avrtoolserialnumber>J41800099437</avrtoolserialnumber>
|
|
||||||
<avrdeviceexpectedsignature>0x1E9705</avrdeviceexpectedsignature>
|
|
||||||
<com_atmel_avrdbg_tool_stk500>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.stk500</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>STK500</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_stk500>
|
|
||||||
<avrtoolinterface>ISP</avrtoolinterface>
|
|
||||||
<avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
|
|
||||||
<AsfFrameworkConfig>
|
|
||||||
<framework-data xmlns="">
|
|
||||||
<options />
|
|
||||||
<configurations />
|
|
||||||
<files />
|
|
||||||
<documentation help="" />
|
|
||||||
<offline-documentation help="" />
|
|
||||||
<dependencies>
|
|
||||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.47.0" />
|
|
||||||
</dependencies>
|
|
||||||
</framework-data>
|
|
||||||
</AsfFrameworkConfig>
|
|
||||||
<com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>ISP</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
|
||||||
<ToolNumber>J41800099437</ToolNumber>
|
|
||||||
<ToolName>Atmel-ICE</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_atmelice>
|
|
||||||
<custom>
|
|
||||||
<ToolOptions>
|
|
||||||
<InterfaceProperties>
|
|
||||||
<IspClock>125000</IspClock>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType>custom</ToolType>
|
|
||||||
<ToolNumber>
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName>Custom Programming Tool</ToolName>
|
|
||||||
</custom>
|
|
||||||
<com_atmel_avrdbg_tool_simulator>
|
|
||||||
<ToolOptions xmlns="">
|
|
||||||
<InterfaceProperties>
|
|
||||||
</InterfaceProperties>
|
|
||||||
<InterfaceName>
|
|
||||||
</InterfaceName>
|
|
||||||
</ToolOptions>
|
|
||||||
<ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
|
|
||||||
<ToolNumber xmlns="">
|
|
||||||
</ToolNumber>
|
|
||||||
<ToolName xmlns="">Simulator</ToolName>
|
|
||||||
</com_atmel_avrdbg_tool_simulator>
|
|
||||||
<AAFDebugger>
|
|
||||||
<AAFDebugFiles>
|
|
||||||
</AAFDebugFiles>
|
|
||||||
</AAFDebugger>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega1284p</avrgcc.common.Device>
|
|
||||||
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
|
||||||
<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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>NDEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
|
||||||
<ToolchainSettings>
|
|
||||||
<AvrGccCpp>
|
|
||||||
<avrgcc.common.Device>-mmcu=atmega1284p</avrgcc.common.Device>
|
|
||||||
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
|
||||||
<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\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
|
||||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcc.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcc.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcc.compiler.warnings.ExtraWarnings>True</avrgcc.compiler.warnings.ExtraWarnings>
|
|
||||||
<avrgcc.compiler.warnings.Pedantic>True</avrgcc.compiler.warnings.Pedantic>
|
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -std=c11</avrgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<ListValues>
|
|
||||||
<Value>DEBUG</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize (-O1)</avrgcccpp.compiler.optimization.level>
|
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
|
||||||
<avrgcccpp.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcccpp.compiler.optimization.DebugLevel>
|
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
|
||||||
<avrgcccpp.compiler.warnings.Pedantic>True</avrgcccpp.compiler.warnings.Pedantic>
|
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-fno-threadsafe-statics -Wextra -std=c++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<ListValues>
|
|
||||||
<Value>libm</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<ListValues>
|
|
||||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include</Value>
|
|
||||||
</ListValues>
|
|
||||||
</avrgcccpp.assembler.general.IncludePaths>
|
|
||||||
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
|
|
||||||
</AvrGccCpp>
|
|
||||||
</ToolchainSettings>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="clock.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="flash\flash.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="io\io.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="main.cpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="type\type.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\config.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware0.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\hardware1.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\software.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="uart\uart.hpp">
|
|
||||||
<SubType>compile</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="flash" />
|
|
||||||
<Folder Include="io" />
|
|
||||||
<Folder Include="uart" />
|
|
||||||
<Folder Include="type" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
|
||||||
</Project>
|
|
||||||
1
tsb/type
1
tsb/type
Submodule tsb/type deleted from ce31ef017f
1
tsb/uart
1
tsb/uart
Submodule tsb/uart deleted from 8f88cdccea
Reference in New Issue
Block a user