Skip to content

Commit 422aeb2

Browse files
Merge pull request electro-smith#158 from andrewikenberry/usb_cdc
USB CDC
2 parents 8ceecc6 + 2a2ff6c commit 422aeb2

27 files changed

Lines changed: 3209 additions & 17 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Project Name
2+
TARGET = ex_SeedUSB_CDC
3+
4+
# Sources
5+
CPP_SOURCES = SeedUSB_CDC.cpp
6+
7+
# Library Locations
8+
LIBDAISY_DIR = ../../../../libdaisy
9+
DAISYSP_DIR = ../../../../daisysp
10+
11+
# Core location, and generic makefile.
12+
SYSTEM_FILES_DIR = ../../../../core
13+
include $(SYSTEM_FILES_DIR)/Makefile
14+
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<?xml version="1.0"?>
2+
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ConfigurationName>Debug</ConfigurationName>
4+
<Project xsi:type="com.visualgdb.project.embedded">
5+
<CustomSourceDirectories>
6+
<Directories />
7+
<PathStyle>MinGWUnixSlash</PathStyle>
8+
<LocalDirForAbsolutePaths>$(ToolchainDir)</LocalDirForAbsolutePaths>
9+
</CustomSourceDirectories>
10+
<MainSourceDirectory>$(ProjectDir)</MainSourceDirectory>
11+
<ExportAdvancedBuildVariables>false</ExportAdvancedBuildVariables>
12+
<EmbeddedProfileFile>stm32.xml</EmbeddedProfileFile>
13+
</Project>
14+
<Build xsi:type="com.visualgdb.build.msbuild">
15+
<ToolchainID>
16+
<Version>
17+
<Revision>0</Revision>
18+
</Version>
19+
</ToolchainID>
20+
<ProjectFile>SeedUSB_CDC.vcxproj</ProjectFile>
21+
<RemoteBuildEnvironment>
22+
<Records />
23+
<EnvironmentSetupFiles />
24+
</RemoteBuildEnvironment>
25+
<ParallelJobCount>1</ParallelJobCount>
26+
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
27+
</Build>
28+
<CustomBuild>
29+
<PreSyncActions />
30+
<PreBuildActions />
31+
<PostBuildActions />
32+
<PreCleanActions />
33+
<PostCleanActions />
34+
</CustomBuild>
35+
<CustomDebug>
36+
<PreDebugActions />
37+
<PostDebugActions />
38+
<DebugStopActions />
39+
<BreakMode>Default</BreakMode>
40+
</CustomDebug>
41+
<DeviceTerminalSettings>
42+
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
43+
<ComPortName>COM4</ComPortName>
44+
<AdvancedSettings>
45+
<BaudRate>115200</BaudRate>
46+
<DataBits>8</DataBits>
47+
<Parity>None</Parity>
48+
<StopBits>One</StopBits>
49+
<FlowControl>None</FlowControl>
50+
</AdvancedSettings>
51+
</Connection>
52+
<LastConnectionTime>0</LastConnectionTime>
53+
<EchoTypedCharacters>false</EchoTypedCharacters>
54+
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
55+
<ReconnectAutomatically>false</ReconnectAutomatically>
56+
<DisplayMode>ASCII</DisplayMode>
57+
<Colors>
58+
<Background>
59+
<Alpha>255</Alpha>
60+
<Red>0</Red>
61+
<Green>0</Green>
62+
<Blue>0</Blue>
63+
</Background>
64+
<Disconnected>
65+
<Alpha>255</Alpha>
66+
<Red>169</Red>
67+
<Green>169</Green>
68+
<Blue>169</Blue>
69+
</Disconnected>
70+
<Text>
71+
<Alpha>255</Alpha>
72+
<Red>211</Red>
73+
<Green>211</Green>
74+
<Blue>211</Blue>
75+
</Text>
76+
<Echo>
77+
<Alpha>255</Alpha>
78+
<Red>144</Red>
79+
<Green>238</Green>
80+
<Blue>144</Blue>
81+
</Echo>
82+
<Inactive>
83+
<Alpha>255</Alpha>
84+
<Red>169</Red>
85+
<Green>169</Green>
86+
<Blue>169</Blue>
87+
</Inactive>
88+
</Colors>
89+
<HexSettings>
90+
<MaximumBytesPerLine>16</MaximumBytesPerLine>
91+
<ShowTextView>true</ShowTextView>
92+
<BreaksAroundEcho>true</BreaksAroundEcho>
93+
<AutoSend>true</AutoSend>
94+
<SendAsHex>true</SendAsHex>
95+
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
96+
</HexSettings>
97+
<LineEnding>LF</LineEnding>
98+
<TreatLFAsCRLF>false</TreatLFAsCRLF>
99+
<KeepOpenAfterExit>true</KeepOpenAfterExit>
100+
<ShowAfterProgramming>false</ShowAfterProgramming>
101+
</DeviceTerminalSettings>
102+
<CustomShortcuts>
103+
<Shortcuts />
104+
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
105+
</CustomShortcuts>
106+
<UserDefinedVariables />
107+
<ImportedPropertySheets />
108+
<CodeSense>
109+
<Enabled>Unknown</Enabled>
110+
<ExtraSettings>
111+
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
112+
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
113+
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
114+
<FormattingEngine xsi:nil="true" />
115+
</ExtraSettings>
116+
<CodeAnalyzerSettings>
117+
<Enabled>false</Enabled>
118+
</CodeAnalyzerSettings>
119+
</CodeSense>
120+
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
121+
<Configurations />
122+
<ProgramArgumentsSuggestions />
123+
<Debug xsi:type="com.visualgdb.debug.embedded">
124+
<AdditionalStartupCommands />
125+
<AdditionalGDBSettings>
126+
<Features>
127+
<DisableAutoDetection>false</DisableAutoDetection>
128+
<UseFrameParameter>true</UseFrameParameter>
129+
<SimpleValuesFlagSupported>true</SimpleValuesFlagSupported>
130+
<ListLocalsSupported>true</ListLocalsSupported>
131+
<ByteLevelMemoryCommandsAvailable>true</ByteLevelMemoryCommandsAvailable>
132+
<ThreadInfoSupported>true</ThreadInfoSupported>
133+
<PendingBreakpointsSupported>true</PendingBreakpointsSupported>
134+
<SupportTargetCommand>true</SupportTargetCommand>
135+
<ReliableBreakpointNotifications>true</ReliableBreakpointNotifications>
136+
</Features>
137+
<EnableSmartStepping>false</EnableSmartStepping>
138+
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
139+
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
140+
<UseAppleExtensions>false</UseAppleExtensions>
141+
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
142+
<MakeLogFile>false</MakeLogFile>
143+
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
144+
<UseRelativePathsOnly>false</UseRelativePathsOnly>
145+
<ExitAction>None</ExitAction>
146+
<DisableDisassembly>false</DisableDisassembly>
147+
<ExamineMemoryWithXCommand>true</ExamineMemoryWithXCommand>
148+
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
149+
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
150+
<DisableSignals>false</DisableSignals>
151+
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
152+
<EnableNonStopMode>false</EnableNonStopMode>
153+
<MaxBreakpointLimit>0</MaxBreakpointLimit>
154+
</AdditionalGDBSettings>
155+
<DebugMethod>
156+
<ID>com.sysprogs.arm.openocd</ID>
157+
<Configuration xsi:type="com.visualgdb.edp.openocd.settings">
158+
<CommandLine>-f interface/stlink.cfg -f target/stm32h7x.cfg -c init -c "reset init"</CommandLine>
159+
<ExtraParameters>
160+
<Frequency xsi:nil="true" />
161+
<BoostedFrequency xsi:nil="true" />
162+
<ConnectUnderReset>false</ConnectUnderReset>
163+
</ExtraParameters>
164+
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
165+
<ProgramMode>Enabled</ProgramMode>
166+
<StartupCommands>
167+
<string>set remotetimeout 60</string>
168+
<string>target remote :$$SYS:GDB_PORT$$</string>
169+
<string>mon halt</string>
170+
<string>mon reset init</string>
171+
<string>load</string>
172+
</StartupCommands>
173+
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
174+
<PreferredGDBPort>0</PreferredGDBPort>
175+
<PreferredTelnetPort>0</PreferredTelnetPort>
176+
</Configuration>
177+
</DebugMethod>
178+
<AutoDetectRTOS>true</AutoDetectRTOS>
179+
<SemihostingSupport>Auto</SemihostingSupport>
180+
<SemihostingPollingDelay>0</SemihostingPollingDelay>
181+
<StepIntoEntryPoint>false</StepIntoEntryPoint>
182+
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
183+
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
184+
<StopAtEntryPoint>false</StopAtEntryPoint>
185+
<EnableVirtualHalts>false</EnableVirtualHalts>
186+
<DynamicAnalysisSettings />
187+
<EndOfStackSymbol>_estack</EndOfStackSymbol>
188+
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
189+
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
190+
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
191+
</Debug>
192+
</VisualGDBProjectSettings2>
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0"?>
2+
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ConfigurationName>Release</ConfigurationName>
4+
<Project xsi:type="com.visualgdb.project.embedded">
5+
<CustomSourceDirectories>
6+
<Directories />
7+
<PathStyle>MinGWUnixSlash</PathStyle>
8+
<LocalDirForAbsolutePaths>$(ToolchainDir)</LocalDirForAbsolutePaths>
9+
</CustomSourceDirectories>
10+
<MainSourceDirectory>$(ProjectDir)</MainSourceDirectory>
11+
<ExportAdvancedBuildVariables>false</ExportAdvancedBuildVariables>
12+
<EmbeddedProfileFile>stm32.xml</EmbeddedProfileFile>
13+
</Project>
14+
<Build xsi:type="com.visualgdb.build.msbuild">
15+
<ToolchainID>
16+
<Version>
17+
<Revision>0</Revision>
18+
</Version>
19+
</ToolchainID>
20+
<ProjectFile>SeedUSB_CDC.vcxproj</ProjectFile>
21+
<ParallelJobCount>0</ParallelJobCount>
22+
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
23+
</Build>
24+
<CustomBuild>
25+
<PreSyncActions />
26+
<PreBuildActions />
27+
<PostBuildActions />
28+
<PreCleanActions />
29+
<PostCleanActions />
30+
</CustomBuild>
31+
<CustomDebug>
32+
<PreDebugActions />
33+
<PostDebugActions />
34+
<DebugStopActions />
35+
<BreakMode>Default</BreakMode>
36+
</CustomDebug>
37+
<CustomShortcuts>
38+
<Shortcuts />
39+
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
40+
</CustomShortcuts>
41+
<UserDefinedVariables />
42+
<CodeSense>
43+
<Enabled>Unknown</Enabled>
44+
<ExtraSettings>
45+
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
46+
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
47+
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
48+
<FormattingEngine xsi:nil="true" />
49+
</ExtraSettings>
50+
<CodeAnalyzerSettings>
51+
<Enabled>false</Enabled>
52+
</CodeAnalyzerSettings>
53+
</CodeSense>
54+
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
55+
<Debug xsi:type="com.visualgdb.debug.embedded">
56+
<AdditionalStartupCommands />
57+
<AdditionalGDBSettings>
58+
<Features>
59+
<DisableAutoDetection>false</DisableAutoDetection>
60+
<UseFrameParameter>false</UseFrameParameter>
61+
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
62+
<ListLocalsSupported>false</ListLocalsSupported>
63+
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
64+
<ThreadInfoSupported>false</ThreadInfoSupported>
65+
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
66+
<SupportTargetCommand>false</SupportTargetCommand>
67+
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
68+
</Features>
69+
<EnableSmartStepping>false</EnableSmartStepping>
70+
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
71+
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
72+
<UseAppleExtensions>false</UseAppleExtensions>
73+
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
74+
<MakeLogFile>false</MakeLogFile>
75+
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
76+
<UseRelativePathsOnly>false</UseRelativePathsOnly>
77+
<ExitAction>None</ExitAction>
78+
<DisableDisassembly>false</DisableDisassembly>
79+
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
80+
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
81+
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
82+
<DisableSignals>false</DisableSignals>
83+
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
84+
<EnableNonStopMode>false</EnableNonStopMode>
85+
<MaxBreakpointLimit>0</MaxBreakpointLimit>
86+
</AdditionalGDBSettings>
87+
<DebugMethod>
88+
<ID>com.sysprogs.arm.openocd</ID>
89+
<Configuration xsi:type="com.visualgdb.edp.openocd.settings">
90+
<CommandLine>-f interface/stlink.cfg -f target/stm32h7x.cfg -c init -c "reset init"</CommandLine>
91+
<ExtraParameters>
92+
<Frequency xsi:nil="true" />
93+
<BoostedFrequency xsi:nil="true" />
94+
<ConnectUnderReset>false</ConnectUnderReset>
95+
</ExtraParameters>
96+
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
97+
<ProgramMode>Enabled</ProgramMode>
98+
<StartupCommands>
99+
<string>set remotetimeout 60</string>
100+
<string>target remote :$$SYS:GDB_PORT$$</string>
101+
<string>mon halt</string>
102+
<string>mon reset init</string>
103+
<string>load</string>
104+
</StartupCommands>
105+
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
106+
<PreferredGDBPort>0</PreferredGDBPort>
107+
<PreferredTelnetPort>0</PreferredTelnetPort>
108+
</Configuration>
109+
</DebugMethod>
110+
<AutoDetectRTOS>true</AutoDetectRTOS>
111+
<SemihostingSupport>Auto</SemihostingSupport>
112+
<SemihostingPollingDelay>0</SemihostingPollingDelay>
113+
<StepIntoEntryPoint>false</StepIntoEntryPoint>
114+
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
115+
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
116+
<StopAtEntryPoint>false</StopAtEntryPoint>
117+
<EnableVirtualHalts>false</EnableVirtualHalts>
118+
<DynamicAnalysisSettings />
119+
<EndOfStackSymbol>_estack</EndOfStackSymbol>
120+
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
121+
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
122+
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
123+
</Debug>
124+
</VisualGDBProjectSettings2>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
#include "daisy_seed.h"
4+
5+
static daisy_handle hw;
6+
7+
int main(void)
8+
{
9+
daisy_seed_init(&hw);
10+
int tick_cnt = 0;
11+
char buff[512];
12+
while(1)
13+
{
14+
dsy_system_delay(500);
15+
sprintf(buff, "Tick:\t%d\r\n", tick_cnt);
16+
hw.usb_handle.TransmitInternal((uint8_t*)buff, strlen(buff));
17+
tick_cnt = (tick_cnt + 1) % 100;
18+
}
19+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29102.190
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SeedUSB_CDC", "SeedUSB_CDC.vcxproj", "{EA625EAA-7C64-4842-AE4B-E618D4BD7D8F}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B41DDCEC-68B1-473A-BD7B-774476F0115A}"
9+
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdaisy", "..\..\..\..\libdaisy\libdaisy.vcxproj", "{1B07A9D3-1E1B-488A-9817-4B13EECA191C}"
11+
EndProject
12+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "daisysp", "..\..\..\..\daisysp\daisysp.vcxproj", "{44F4AEA3-A6B2-4F03-9C28-34B2336BDF57}"
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|VisualGDB = Debug|VisualGDB
17+
Release|VisualGDB = Release|VisualGDB
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{EA625EAA-7C64-4842-AE4B-E618D4BD7D8F}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
21+
{EA625EAA-7C64-4842-AE4B-E618D4BD7D8F}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
22+
{EA625EAA-7C64-4842-AE4B-E618D4BD7D8F}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
23+
{EA625EAA-7C64-4842-AE4B-E618D4BD7D8F}.Release|VisualGDB.Build.0 = Release|VisualGDB
24+
{1B07A9D3-1E1B-488A-9817-4B13EECA191C}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
25+
{1B07A9D3-1E1B-488A-9817-4B13EECA191C}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
26+
{1B07A9D3-1E1B-488A-9817-4B13EECA191C}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
27+
{1B07A9D3-1E1B-488A-9817-4B13EECA191C}.Release|VisualGDB.Build.0 = Release|VisualGDB
28+
{44F4AEA3-A6B2-4F03-9C28-34B2336BDF57}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
29+
{44F4AEA3-A6B2-4F03-9C28-34B2336BDF57}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
30+
{44F4AEA3-A6B2-4F03-9C28-34B2336BDF57}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
31+
{44F4AEA3-A6B2-4F03-9C28-34B2336BDF57}.Release|VisualGDB.Build.0 = Release|VisualGDB
32+
EndGlobalSection
33+
GlobalSection(SolutionProperties) = preSolution
34+
HideSolutionNode = FALSE
35+
EndGlobalSection
36+
GlobalSection(ExtensibilityGlobals) = postSolution
37+
SolutionGuid = {5ACB48A9-9162-4D61-926D-FF1C67B99779}
38+
EndGlobalSection
39+
EndGlobal

0 commit comments

Comments
 (0)