# stm32-vserprog-lpc:
## flashrom serprog LPC programmer based on STM32 MCU & USB CDC protocol.
**This project based on [`stm32-vserprog`](https://github.com/dword1511/stm32-vserprog) and [`frser-teensyflash`](https://github.com/urjaman/frser-teensyflash) projects.**
* * *
### Features
* Based on open-source Cortex-M3 library [`libopencm3`](https://github.com/libopencm3/libopencm3).
* `flashrom` serprog protocol (see [`flashrom wiki`](https://www.flashrom.org/Serprog)).
* * *
### Installation
1. Install `stm32flash` and the `gcc-arm-none-eabi` toolchain.
On Debian, simply do the following:
```bash
$ apt-get install stm32flash gcc-arm-none-eabi
```
3. Clone and compile.
Simply type (change the board name accordingly, for details see the header of the `Makefile` or just type `make`):
```bash
git clone https://github.com/wosk/stm32-vserprog-lpc.git
make BOARD=stm32f103-ugly
```
4. Program.
Program via USB-UART adapter need pulled up _BOOT0_ pin and pulled low _BOOT1_ pin (See section 3.4 [`reference manual STM32F1xxxx `](http://www.st.com/resource/en/reference_manual/CD00171190.pdf)).
```bash
make BOARD=stm32f103-ugly flash
```
Do not forget to pull low _BOOT0_ pin after flashing for run firmware.
* * *
### Usage
#### Hardware side
For connecting PLCC LPC flash need:
* PLCC 32 pin DIP socket (DS1032-32D)
* 9 necessary wires (for Vss, Vdd, LFRAME#, LCLK, RST#, LAD[3:0])
* 3 possibly necessary wires (for connect RST# with INIT#, Vdd (pin 25) with Vdd (pin 32), Vss (pin 16) with Vss (pin 28))
* 1 resistor about 150...1000 Ohm (for pull up WP# and TBL# for disable write protection)
The final scheme:
<img src="./doc/connection.svg" alt="scheme"/>
#### Software side
The following assumes Linux platform, and that the programmer appears as `/dev/ttyACM0`.
1. To read a flash chip:
```bash
flashrom -p serprog:dev=/dev/ttyACM0 -r file-to-save.bin -c chip-name
```
2. To write a flash chip:
```bash
flashrom -p serprog:dev=/dev/ttyACM0 -w file-to-load.bin -c chip-name
```
* Flash chips are checked and blocks that are not empty are automatically erased.
* Images are verified after writing automatically.
* The whole process can take a few minutes.
3. To erase a flash chip:
```bash
flashrom -p serprog:dev=/dev/ttyACM0 -E -c chip-name
```
* * *
### Tested
* Winbond W39V040BPZ 512 kB (read 19 sec, erase 26 sec, write 6 min)
* SST 49LF040B 512 kB (read 18 sec, erase 21 sec, write 6 min)
### Known bugs
* Probing chip (without argument "-c chipname") not work properly.
### Problems?
1. If you encountered something like "`Error: Cannot open serial port: Device or resource busy`", please try to stop or remove `ModemManager`.
1. Check your wirings and `flashrom` version. Do not forget to power the flash chip itself if operating on a breadboard or prototype board.
1. If you are sure it is caused by bugs in the programmer's firmware,
please [open a new ticket](https://github.com/wosk/stm32-vserprog-lpc/issues) and provide details, e.g. the board you are using and `flashrom -VVV`'s output. I appreciate your feedback.
没有合适的资源?快使用搜索试试~ 我知道了~
基于STM32 MCU的flashrom serprog LPC编程器
共26个文件
h:7个
c:7个
jpg:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 70 浏览量
2024-07-06
20:56:13
上传
评论
收藏 1.48MB ZIP 举报
温馨提示
安装 安装和工具链。stm32flashgcc-arm-none-eabi 在 Debian 上,只需执行以下操作: $ apt-get install stm32flash gcc-arm-none-eabi 克隆和编译。 只需键入(相应地更改板名称,有关详细信息,请参阅标题或仅键入):Makefilemake git clone https://github.com/wosk/stm32-vserprog-lpc.git make BOARD=stm32f103-ugly 程序。 通过 USB-UART 适配器进行编程需要拉高 BOOT0 引脚和拉低 BOOT1 引脚(参见 STM3.4F1xxxx 参考手册第 3.4 节)。 make BOARD=stm32f103-ugly flash 不要忘记在闪烁运行固件后拉低 BOOT0 引脚。 用法 硬件方面 连接PLCC LPC闪存需要: PLCC 32针DIP插座(DS1032-32D) 9 根必要的电线(用于 Vss、Vdd、LFRAME#、LCLK、RST#、LAD[3:0]) 3 根可能需要的电线(用于将 RS
资源推荐
资源详情
资源评论
收起资源包目录
stm32-vserprog-lpc-master.zip (26个子文件)
stm32-vserprog-lpc-master
printf.c 13KB
semihosting.c 4KB
traceswo.c 2KB
doc
DS1032-pins.jpg 523KB
PLCC-DS1032-32D.jpg 46KB
connection.svg 80KB
reading_LPC_W39V040B.png 66KB
stm32-vserprog-lpc-mockup.jpg 850KB
Makefile 3KB
LICENSE 34KB
vserprog.c 9KB
traceswo.h 232B
lpc.c 5KB
main.h 1001B
.gitmodules 96B
lpc.h 269B
usbcdc.c 9KB
.gitignore 83B
boards
stm32f103-ugly.h 1KB
stm32f103-ugly.mk 12B
stm32f103.mk 208B
main.c 2KB
README.md 3KB
serprog.h 2KB
semihosting.h 2KB
usbcdc.h 440B
libopencm3
共 26 条
- 1
资源评论
hakesashou
- 粉丝: 5765
- 资源: 1603
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功