From 4197727c10c0a6bb01034458754376104c9ec7e8 Mon Sep 17 00:00:00 2001 From: AJM Date: Fri, 21 May 2010 20:02:22 -0400 Subject: minor mods to adjust the driver number and the vendor product id's (serial port now 1eaf:0004) and fixed a bug in reset.py, added a no-delay usb serial loop to main.cpp as an example. has no problem at 115200 in minicom! --- Makefile | 2 +- libmaple/usb/usb_config.h | 4 ++-- notes/45-maple.rules | 1 + reset.py | 23 ++++++++++++++--------- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b85e28e..8bed507 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ program_ram: ram program_flash: flash ./reset.py ./wait.py - $(DFU) -a1 -d 0110:1001 -D build/main.bin -R + $(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D build/main.bin -R program_jtag: jtag openocd -f stm32conf/flash.cfg diff --git a/libmaple/usb/usb_config.h b/libmaple/usb/usb_config.h index 5cdbcd7..db549e5 100644 --- a/libmaple/usb/usb_config.h +++ b/libmaple/usb/usb_config.h @@ -5,8 +5,8 @@ #include "usb_lib.h" -#define VCOM_ID_VENDOR 0x0110 -#define VCOM_ID_PRODUCT 0x1003 +#define VCOM_ID_VENDOR 0x1EAF +#define VCOM_ID_PRODUCT 0x1004 #define USB_CONFIG_MAX_POWER (100 >> 1) diff --git a/notes/45-maple.rules b/notes/45-maple.rules index e3032b9..c2e6c56 100644 --- a/notes/45-maple.rules +++ b/notes/45-maple.rules @@ -3,5 +3,6 @@ BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="maple_rules_end" SYSFS{idProduct}=="1001", SYSFS{idVendor}=="0110", MODE="664", GROUP="plugdev" SYSFS{idProduct}=="1002", SYSFS{idVendor}=="0110", MODE="664", GROUP="plugdev" SYSFS{idProduct}=="0003", SYSFS{idVendor}=="1EAF", MODE="664", GROUP="plugdev" +SYSFS{idProduct}=="0004", SYSFS{idVendor}=="1EAF", MODE="664", GROUP="plugdev" LABEL="maple_rules_end" diff --git a/reset.py b/reset.py index 1a4d515..020d8cb 100755 --- a/reset.py +++ b/reset.py @@ -3,16 +3,21 @@ import serial import time -ser = serial.Serial('/dev/ttyACM0', baudrate=115200) -ser.open() -# pull dtr and rts low -ser.setRTS(0) -ser.setDTR(0) +try: + ser = serial.Serial('/dev/ttyACM0', baudrate=115200) + ser.open() -# toggle DTR -ser.setDTR(1) + # pull dtr and rts low + ser.setRTS(0) + ser.setDTR(0) -# close -ser.close() + # toggle DTR + ser.setDTR(1) + + # close + ser.close() + +except: + print "Failed to open the serial port for reset, perhaps this is your first upload or the board was already in bootloader mode" -- cgit v1.2.3