Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
freepdk committed Apr 6, 2019
1 parent cd4cb67 commit a7f53f5
Show file tree
Hide file tree
Showing 61 changed files with 20,746 additions and 1 deletion.
Binary file added Firmware/EASYPDKPROG.bin
Binary file not shown.
41 changes: 41 additions & 0 deletions Firmware/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
************************
DFU-NOTES for firmware
************************

Install "dfu-util" on your computer: http://dfu-util.sourceforge.net
(macOS: brew install dfu-util / Linux: sudo apt-get install dfu-util / Windows: follow the guide on dfu-util web site)

1. unplug USB from Easy PDK programmer

2. on Easy PDK programmer PRESS AND KEEP HOLDING THE BUTTON

3. WHILE STILL HOLDING THE BUTTON connect USB

4. ONLY AFTER USB is connected release the button

5. EXECUTE:
dfu-util -d 0483:df11 -a "@Internal Flash /0x08000000/064*0002Kg" --dfuse-address 0x08000000 -D EASYPDKPROG.bin

EXAMPLE OUTPUT:
---------------
dfu-util 0.9
...
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 27635
Download [=========================] 100% 27635 bytes
Download done.
File downloaded successfully

6. UNPLUG USB from Easy PDK programmer

80 changes: 80 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
macOS:
======
homebrew: make all

Windows:
========
mingw: make all
msys2: make all

Driver for older Windows versions:
==================================
On Windows 7,8,10 Windows should find the correct STM32 virtual comport driver automatically (online).
If have problems installing the driver on older Windows versions (XP, Vista®, 7, and 8.x) you
can point to the folder "WindowsSTM32VCPDriver" when asked for the driver. It contains the required .inf and
the corresponding Microsoft signed .cat file. You also can download an installer for the driver from ST website:
https://www.st.com/en/development-tools/stsw-stm32102.html

Linux:
======
make all

Problems with Linux distributions (Ubuntu and others):
======================================================

To reduce the initial delay after connecting USB you need to exclude the virtual com port from "modemmanager" to check it as a modem.
You can do this by the following command:

sudo bash -c 'cp udevrules/90-stm32vcp.rules /etc/udev/rules.d/ ; udevadm control --reload'


************

Usage: easypdkprog [OPTION...] list|probe|read|write|erase|start [FILE]
easypdkprog -- read, write and execute programs on PADAUK microcontroller
https://free-pdk.github.io

-b, --bin Binary file output. Default: ihex8
-f, --fuse=FUSE FUSE value, e.g. 0x31FD
-i, --icid=ID IC ID 12 bit, e.g. 0xAA1
--noverify Skip verify after write
--nocalibrate Skip calibration after write.
-n, --icname=NAME IC name, e.g. PFS154
--noblankchk Skip blank check before write
--noerase Skip erase before write
-p, --port=PORT COM port of programmer. Default: Auto search
-r, --runvdd=VDD Voltage for running the IC. Default: 5.0
--securefill Fill unused space with 0 (NOP) to prevent readout
-v, --verbose Verbose output
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version


Examples:

list all supported ICs:
easypdkprog list

probe IC in socket (can determine IC type/name):
easypdkprog probe

read IC to readout.hex file:
easypdkprog -n PFS154 read readout.hex

read IC to readout.bin file:
easypdkprog -n PFS154 read readout.hex -b

write IC:
easypdkprog -n PFS154 write myprog.hex

erase IC (flash based only):
easypdkprog -n PFS154 erase

start IC in socket (interactive mode):
all serial output sent form IC-PA.7 (autobaud detection) is displayed on screen
all input from keyboard is sent as serial to IC-PA.0 (using same detected baud as receive)

easypdkprog start


1 change: 1 addition & 0 deletions Linux_udevrules/90-stm32vcp.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ENV{ID_MM_DEVICE_IGNORE}="1"
11 changes: 11 additions & 0 deletions Linux_udevrules/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Problems with Linux (Ubuntu and others):
========================================

To reduce the initial delay after connecting USB you need to exclude the virtual com port from "modemmanager" to check it as a modem.

Copy the udev rule file "90-stm32vcp.rules" to "/etc/udev/rules.d" and reload udev manager with "udevadm control --reload"

Or just use the following command:

sudo bash -c 'cp 90-stm32vcp.rules /etc/udev/rules.d/ ; udevadm control --reload'

44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
CC ?= gcc
RM ?= rm -rf
STRIP ?= strip

CFLAGS += -Wall -O2 -std=c99

all: easypdkprog

ifeq ($(OS),Windows_NT)
EXE_EXTENSION := .exe
ARGPSA = lib/argp-standalone-1.3
ARGPSALIB = $(ARGPSA)/libargp.a
CFLAGS += -I$(ARGPSA)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -largp
endif
endif

DEP= $(wildcard *.h)
SRC= serialcom.c fpdkutil.c fpdkcom.c fpdkicdata.c fpdkihex8.c fpdkiccalib.c
OBJ= $(subst .c,.o,$(SRC))

easypdkprog: $(ARGPSALIB) $(DEP) $(OBJ) easypdkprog.c
$(CC) $(CFLAGS) $(LDFLAGS) -o easypdkprog easypdkprog.c $(OBJ) $(LIBS) $(ARGPSALIB)
$(STRIP) easypdkprog$(EXE_EXTENSION)

simpletest: $(DEP) $(OBJ) simpletest.c
$(CC) $(CFLAGS) $(LDFLAGS) -o simpletest simpletest.c $(OBJ) $(LIBS)

$(ARGPSALIB):
cd $(ARGPSA) && sh configure
$(MAKE) -C $(ARGPSA)

clean:
$(RM) $(OBJ)
$(RM) easypdkprog$(EXE_EXTENSION)
$(RM) simpletest$(EXE_EXTENSION)

distclean: clean
ifeq ($(OS),Windows_NT)
-$(MAKE) distclean -C $(ARGPSA)
endif
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
# easy-pdk-programmer-software
EASY PDK PROGRAMMER
-------------------

```
Usage: easypdkprog [OPTION...] list|probe|read|write|erase|start [FILE]
easypdkprog -- read, write and execute programs on PADAUK microcontroller
https://free-pdk.github.io
-b, --bin Binary file output. Default: ihex8
-f, --fuse=FUSE FUSE value, e.g. 0x31FD
-i, --icid=ID IC ID 12 bit, e.g. 0xAA1
--noverify Skip verify after write
--nocalibrate Skip calibration after write.
-n, --icname=NAME IC name, e.g. PFS154
--noblankchk Skip blank check before write
--noerase Skip erase before write
-p, --port=PORT COM port of programmer. Default: Auto search
-r, --runvdd=VDD Voltage for running the IC. Default: 5.0
--securefill Fill unused space with 0 (NOP) to prevent readout
-v, --verbose Verbose output
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
```

Examples:

list all supported ICs:
``` easypdkprog list```

probe IC in socket (can determine IC type/name):
``` easypdkprog probe```

read IC to readout.hex file:
``` easypdkprog -n PFS154 read readout.hex```

read IC to readout.bin file:
``` easypdkprog -n PFS154 read readout.hex -b```

write IC:
``` easypdkprog -n PFS154 write myprog.hex```

erase IC (flash based only):
``` easypdkprog -n PFS154 erase```

start IC in socket (interactive mode):
all serial output sent form IC-PA.7 (autobaud detection) is displayed on screen
all input from keyboard is sent as serial to IC-PA.0 (using same detected baud as receive)

``` easypdkprog start```


Binary file added Windows_STM32VCPDriver/stmcdc.cat
Binary file not shown.
66 changes: 66 additions & 0 deletions Windows_STM32VCPDriver/stmcdc.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
;------------------------------------------------------------------------------
; STMicroelectronics Comunication Device Class driver (CDC) INF FILE
; (C)2013 Copyright STMicroelectronics
;------------------------------------------------------------------------------

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%PRVDR%
CatalogFile=stmcdc.cat
DriverVer=08/02/2013,1.4.0

[SourceDisksNames]
1=%DriversDisk%,,,

[SourceDisksFiles]

[Manufacturer]
%MFGNAME%=DeviceList,NT,NTamd64

[DestinationDirs]
DefaultDestDir = 12

;------------------------------------------------------------------------------
; VID/PID Settings
;------------------------------------------------------------------------------
[DeviceList.NT]
%DESCRIPTION%=DriverInstall,USB\VID_0483&PID_5740

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall,USB\VID_0483&PID_5740

[DriverInstall.NT]
Include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=DriverInstall.NT.AddReg

[DriverInstall.NT.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.NT.Services]
AddService=usbser, 0x00000002, DriverServiceInst

[DriverServiceInst]
DisplayName=%SERVICE%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary= %12%\usbser.sys
LoadOrderGroup = Base

[FakeModemCopyFileSection]

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------

[Strings]
PRVDR = "STMicroelectronics"
MFGNAME = "STMicroelectronics."
DESCRIPTION = "STMicroelectronics Virtual COM Port"
SERVICE = "STM Virtual COM Port"
DriversDisk = "STM Drivers Disk"
Loading

0 comments on commit a7f53f5

Please sign in to comment.