Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
b99ca2cd
Commit
b99ca2cd
authored
Apr 09, 2014
by
Damien George
Browse files
stmhal: Add windows cdc .inf driver to flash filesystem.
parent
8e6f98b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
stmhal/main.c
View file @
b99ca2cd
...
...
@@ -133,6 +133,10 @@ static const char fresh_main_py[] =
"# main.py -- put your code here!
\n
"
;
static
const
char
fresh_pybcdc_inf
[]
=
#include
"pybcdc.h"
;
int
main
(
void
)
{
// TODO disable JTAG
...
...
@@ -206,7 +210,9 @@ soft_reset:
}
HAL_Delay
(
20
);
if
(
i
%
30
==
29
)
{
reset_mode
=
(
reset_mode
+
1
)
&
7
;
if
(
++
reset_mode
>
3
)
{
reset_mode
=
1
;
}
led_state
(
2
,
reset_mode
&
1
);
led_state
(
3
,
reset_mode
&
2
);
led_state
(
4
,
reset_mode
&
4
);
...
...
@@ -310,6 +316,11 @@ soft_reset:
// TODO check we could write n bytes
f_close
(
&
fp
);
// create .inf driver file
f_open
(
&
fp
,
"0:/pybcdc.inf"
,
FA_WRITE
|
FA_CREATE_ALWAYS
);
f_write
(
&
fp
,
fresh_pybcdc_inf
,
sizeof
(
fresh_pybcdc_inf
)
-
1
/* don't count null terminator */
,
&
n
);
f_close
(
&
fp
);
// keep LED on for at least 200ms
sys_tick_wait_at_least
(
start_tick
,
200
);
led_state
(
PYB_LED_R2
,
0
);
...
...
stmhal/pybcdc.h
0 → 100644
View file @
b99ca2cd
"; Windows USB CDC ACM Setup File
\n
"
"; Based on INF files which were:
\n
"
"; Copyright (c) 2000 Microsoft Corporation
\n
"
"; Copyright (C) 2007 Microchip Technology Inc.
\n
"
"; Likely to be covered by the MLPL as found at:
\n
"
"; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>.
\n
"
"
\n
"
"[Version]
\n
"
"Signature=
\"
$Windows NT$
\"\n
"
"Class=Ports
\n
"
"ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
\n
"
"Provider=%MFGNAME%
\n
"
"LayoutFile=layout.inf
\n
"
"DriverVer=03/11/2010,5.1.2600.3
\n
"
"
\n
"
"[Manufacturer]
\n
"
"%MFGNAME%=DeviceList, NTamd64
\n
"
"
\n
"
"[DestinationDirs]
\n
"
"DefaultDestDir=12
\n
"
"
\n
"
";---------------------------------------------------------------------
\n
"
"; Windows 2000/XP/Server2003/Vista/Server2008/7 - 32bit Sections
\n
"
"
\n
"
"[DriverInstall.nt]
\n
"
"include=mdmcpq.inf
\n
"
"CopyFiles=DriverCopyFiles.nt
\n
"
"AddReg=DriverInstall.nt.AddReg
\n
"
"
\n
"
"[DriverCopyFiles.nt]
\n
"
"usbser.sys,,,0x20
\n
"
"
\n
"
"[DriverInstall.nt.AddReg]
\n
"
"HKR,,DevLoader,,*ntkern
\n
"
"HKR,,NTMPDriver,,usbser.sys
\n
"
"HKR,,EnumPropPages32,,
\"
MsPorts.dll,SerialPortPropPageProvider
\"\n
"
"
\n
"
"[DriverInstall.nt.Services]
\n
"
"AddService=usbser, 0x00000002, DriverService.nt
\n
"
"
\n
"
"[DriverService.nt]
\n
"
"DisplayName=%SERVICE%
\n
"
"ServiceType=1
\n
"
"StartType=3
\n
"
"ErrorControl=1
\n
"
"ServiceBinary=%12%
\\
usbser.sys
\n
"
"
\n
"
";---------------------------------------------------------------------
\n
"
"; Windows XP/Server2003/Vista/Server2008/7 - 64bit Sections
\n
"
"
\n
"
"[DriverInstall.NTamd64]
\n
"
"include=mdmcpq.inf
\n
"
"CopyFiles=DriverCopyFiles.NTamd64
\n
"
"AddReg=DriverInstall.NTamd64.AddReg
\n
"
"
\n
"
"[DriverCopyFiles.NTamd64]
\n
"
"usbser.sys,,,0x20
\n
"
"
\n
"
"[DriverInstall.NTamd64.AddReg]
\n
"
"HKR,,DevLoader,,*ntkern
\n
"
"HKR,,NTMPDriver,,usbser.sys
\n
"
"HKR,,EnumPropPages32,,
\"
MsPorts.dll,SerialPortPropPageProvider
\"\n
"
"
\n
"
"[DriverInstall.NTamd64.Services]
\n
"
"AddService=usbser, 0x00000002, DriverService.NTamd64
\n
"
"
\n
"
"[DriverService.NTamd64]
\n
"
"DisplayName=%SERVICE%
\n
"
"ServiceType=1
\n
"
"StartType=3
\n
"
"ErrorControl=1
\n
"
"ServiceBinary=%12%
\\
usbser.sys
\n
"
"
\n
"
";---------------------------------------------------------------------
\n
"
"; Vendor and Product ID Definitions
\n
"
"
\n
"
"[SourceDisksFiles]
\n
"
"[SourceDisksNames]
\n
"
"[DeviceList]
\n
"
"%DESCRIPTION%=DriverInstall, USB
\\
VID_0483&PID_5740&MI_00
\n
"
"
\n
"
"[DeviceList.NTamd64]
\n
"
"%DESCRIPTION%=DriverInstall, USB
\\
VID_0483&PID_5740&MI_00
\n
"
"
\n
"
";---------------------------------------------------------------------
\n
"
"; String Definitions
\n
"
"
\n
"
"[Strings]
\n
"
"MFGFILENAME=
\"
pybcdc
\"\n
"
"MFGNAME=
\"
Micro Python
\"\n
"
"DESCRIPTION=
\"
Pyboard USB Comm Port
\"\n
"
"SERVICE=
\"
USB Serial Driver
\"\n
"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment