页次: 1
这是我自己制作的基于Lattice iCE40UP5k的开源FPGA开发板,主要是这片芯片已经有一整套开源的工具链,只需要在linux下简单安装好就可以开始开发了,对于我这种长期搞linux的人极其具有吸引力,详情请见 icestorm,包括综合(yosys)、布线(arachne-pnr & nextpnr)、时序分析(icetime)、打包(icepack)、烧录(iceprog)等,在国外的创客社区中,基于icestorm开源工具已经催生出了众多的开源开发板,包括icebreaker、fomu、tinyFPGA等,遗憾的是国内还没有此类的开发板,我之前在贸泽上花高价才买到一块lattice官方出的开发板,个人认为这一整套开源的工具链极其具有学习研究价值,以往的FPGA开发者一般来说是不可能了解到底层的实现原理的,一般来说EDA工具是厂商的核心技术之一,是不可能开放的,也许是这个原因,FPGA多年一直都是属于比较小众的产品,不过目前随着产业的发展FPGA也慢慢流行起来了。FPGA开源的工具链还有好几个项目,包括icestorm、trellis、symbiflow等。
值得一提的是板子上我基于STM32实现了一个烧录系统,我称之为iCELink,是基于DAPLink改造的,主要有几个功能
1. 拖拽烧录,将生成的FPGA配置文件直接拖拽至U盘中即可实现烧录
2. 虚拟串口,可和FPGA对接进行调试
3. 引出JTAG功能,若FPGA上的SoC支持JTAG调试,可直接对接调试
4. iCELink的PA8引脚提供12Mhz 时钟(STM32的MCO功能),可作为FPGA的时钟输入(有些设计是FPGA直接和烧录系统共用晶振,然而FPGA的IO可配置,一旦FPGA将和晶振相连的管脚配置成输出,则会导致烧录系统起不来,板子就挂了)
这个设计几乎将DAPLink和STM32的功能都用起来了,个人认为简直是完美的调试下载方案 。
目前已经跑起来了多个risc-v的SoC,以及litex+micropython,还有一个基于6502的系统,板子上引出了多个标准的PMOD接口(得捷定义的通用接口),后续还可以和标准PMOD外设对接,另外引出了一个Micro-USB接口,这是FPGA这边出来的信号,后面还可以玩USB(社区已经实现了USB FullSpeed Core)。
后面还会设计多个PMOD外设供自己学习使用,个人认为这块单板非常适合爱好者研究学习,资深的开发者也可以用来完成一些快速的原型验证,社区还在积极的发展,后续应该还有更多的可玩空间。
更多详细说明请参考
blog
https://www.muselab-tech.com/wan-quan-shi-yong-kai-yuan-gong-ju-lian-de-fpgadan-ban/
github
https://github.com/wuxx/icesugar
感兴趣的朋友欢迎加群875160091一起交流,也欢迎各路高手前来指导学习。
嗯,接一个常见的A4988模块就可以了
目前市面上好像就正点原子出了USB High Speed的DAP仿真器,而且是基于CMSIS-DAP做的,ARM Mbed社区已经停止对CMSIS-DAP的支持了,目前官方社区一直在力推DAPLink的方案,DAPLink相当于CMSIS-DAP的升级版,支持更多的功能。
DAPLink的WEBUSB和拖拽烧录确实很有用,尤其是在板载仿真器、或者儿童教育开发板如Micro-Bit之类的场景,用户侧可以不需要安装任何IDE和驱动即可完成编程。
对于使用USB中断传输的DAP协议,USB High Speed 可在1ms内传递8个microframe,而每个micriframe又包含3个packet,每个packet最大可为1024Bytes,传输速度为
1000 * 3 * 8 * 1024 = 23.4375MB/s,而USB全速设备则只能在1ms内传输64Bytes,传输速度为62.5KB/s,而DAP协议又是应答式的通信,host发送请求数据包 -> DAP回复数据包,所以烧录flash的话速度还得打个对折,极限仅为31.25KB/s。
对于USB High Speed来说,实际上此时的编程瓶颈已经不受限于USB传输速度了,已经完全取决于目标芯片的flash编程速度,以及使用的烧录算法了。
关于DAPLink的前世今生请见这篇文章
痞子衡嵌入式:飞思卡尔Kinetis开发板OpenSDA调试器那些事(上)- 背景与架构
这是基于官方DAPLink实现的方案,芯片是Atmel SAM3U2C,USB High Speed,内置USB高速phy,主频为96Mhz。
目前官方DAPLink支持USB High Speed的方案有SAM3U2C,K26F,LPC4322,综合调研了一下,成本上考虑,SAM3U2C应该是最合适的。
初步测试了一下速度,烧录STM32F4 928KB的镜像,时间在27s左右,从正点原子当前公布的数据来看,应该比他们的快,比jlink v10和stlink v3也要更快一些。
下面是一个和DPALink普通版对比的测评视频
https://www.bilibili.com/video/av71037093
目前方案正在众筹,由于芯片成本比较高,估计价格在50-60之间(众筹相当于是福利,为大家服务:) 楼主基本上是不赚钱的)。
欢迎感兴趣的朋友加入众筹QQ群940182296 一起讨论~!
https://www.muselab-tech.com/zi-ji-dong-shou-po-jie-fcyou-xi/
@wuxx 这篇文章是你写的吗?好牛叉!
晕哥见笑了哈,研究6502很多年了,最近还做了个计算机,有空分享一下
wuxx 说:我也做了个多功能编程器,实际上就是块树莓派扩展板,可以烧录SWD、JTAG、ICSP 接口的单片机,以及SPI-FLASH和I2C-EEPROM。
https://www.muselab-tech.com/ghost/#/editor/post/5c9f341f1dd38200011a44ed
软件全部开源(本来也都是开源软件),大家可以试用一下谢谢分享,我想了解下硬件电路是什么样的,也是开源的吗?
硬件也是开源的,这几天抽空更新到github上去。
博客
https://www.muselab-tech.com/geekgong-ju-ba-shu-mei-pai-bian-cheng-duo-gong-neng-diao-shi-shao-lu-qi/
github
https://github.com/wuxx/RPI-HAT-Programmer
之前大概花半个下午写的小工具,类似树莓派的gpio命令。
源码和二进制都在 https://github.com/wuxx/f1c100s-gpio-tools
具体用法和树莓派的gpio命令类似,如下
root@f1c100s:~#gpio
usage: gpio help
gpio read [PA0|PA1...]
gpio write [PA0|PA1...]
gpio mode [PA0|PA1...] [in|out|...]
gpio readall
gpio dumpall
gpio info
-- github.com/wuxx/f1c100s-gpio-tools --
root@f1c100s:~#gpio read PA0
PA0: 1
root@f1c100s:~#gpio write PA0 0
root@f1c100s:~#gpio read PA0
PA0: 0
root@f1c100s:~#gpio mode PA0 in
root@f1c100s:~#gpio readall
value mode
PA:
PA0: 0 [in]
PA1: 0 [disabled]
PA2: 0 [out]
PA3: 1 [out]
PB:
PB3: 0 [disabled]
PC:
PC0: 0 [spi0_clk]
PC1: 0 [spi0_cs]
PC2: 0 [spi0_miso]
PC3: 0 [spi0_mosi]
PD:
PD0: 0 [lcd_d2]
PD1: 0 [lcd_d3]
PD2: 0 [lcd_d4]
PD3: 0 [lcd_d5]
PD4: 0 [lcd_d6]
PD5: 0 [lcd_d7]
PD6: 0 [lcd_d10]
PD7: 0 [lcd_d11]
PD8: 0 [lcd_d12]
PD9: 0 [lcd_d13]
PD10: 0 [lcd_d14]
PD11: 0 [lcd_d15]
PD12: 0 [lcd_d18]
PD13: 0 [lcd_d19]
PD14: 0 [lcd_d20]
PD15: 0 [lcd_d21]
PD16: 0 [lcd_d22]
PD17: 0 [lcd_d23]
PD18: 0 [lcd_clk]
PD19: 0 [lcd_de]
PD20: 0 [lcd_hsync]
PD21: 0 [lcd_vsync]
PE:
PE0: 0 [uart0_rx]
PE1: 0 [uart0_tx]
PE2: 0 [out]
PE3: 1 [out]
PE4: 1 [out]
PE5: 1 [in]
PE6: 1 [out]
PE7: 0 [disabled]
PE8: 0 [disabled]
PE9: 0 [disabled]
PE10: 1 [out]
PE11: 0 [twi0_sck]
PE12: 0 [twi0_sda]
PF:
PF0: 0 [sdc0_d1]
PF1: 0 [sdc0_d0]
PF2: 0 [sdc0_clk]
PF3: 0 [sdc0_cmd]
PF4: 0 [sdc0_d3]
PF5: 0 [sdc0_d2]
root@f1c100s:~#gpio info
PA0: (in out tp_x1 reserved da_bclk uart1_rts spi1_cs disabled )
PA1: (in out tp_x2 reserved da_lrck uart1_cts spi1_miso disabled )
PA2: (in out tp_y1 pwm0 da_in uart1_rx spi1_clk disabled )
PA3: (in out tp_y2 ir_rx da_out uart1_tx spi1_miso disabled )
PB3: (in out ddr_ref_d ir_rx reserved reserved reserved disabled )
PC0: (reserved out spi0_clk sdc1_clk reserved reserved reserved disabled )
PC1: (in out spi0_cs sdc1_cmd reserved reserved reserved disabled )
PC2: (in out spi0_miso sdc1_d0 reserved reserved reserved disabled )
PC3: (in out spi0_mosi uart0_tx reserved reserved reserved disabled )
PD0: (in out lcd_d2 twi0_sda rsb_sda reserved eintd0 disabled )
PD1: (in out lcd_d3 uart1_rts reserved reserved eintd1 disabled )
PD2: (in out lcd_d4 uart1_cts reserved reserved eintd2 disabled )
PD3: (in out lcd_d5 uart1_rx reserved reserved eintd3 disabled )
PD4: (in out lcd_d6 uart1_tx reserved reserved eintd4 disabled )
PD5: (in out lcd_d7 twi1_sck reserved reserved eintd5 disabled )
PD6: (in out lcd_d10 twi1_sda reserved reserved eintd6 disabled )
PD7: (in out lcd_d11 da_mclk reserved reserved eintd7 disabled )
PD8: (in out lcd_d12 da_bclk reserved reserved eintd8 disabled )
PD9: (in out lcd_d13 da_lrck reserved reserved eintd9 disabled )
PD10: (in out lcd_d14 da_in reserved reserved eintd10 disabled )
PD11: (in out lcd_d15 da_out reserved reserved eintd11 disabled )
PD12: (in out lcd_d18 twi0_sck rsb_sck reserved eintd12 disabled )
PD13: (in out lcd_d19 uart2_tx rsb_sck reserved eintd13 disabled )
PD14: (in out lcd_d20 uart2_rx reserved reserved eintd14 disabled )
PD15: (in out lcd_d21 uart2_rts twi2_sck reserved eintd15 disabled )
PD16: (in out lcd_d22 uart2_cts twi2_sda reserved eintd16 disabled )
PD17: (in out lcd_d23 owa_out reserved reserved eintd17 disabled )
PD18: (in out lcd_clk spi0_cs reserved reserved eintd18 disabled )
PD19: (in out lcd_de spi0_mosi reserved reserved eintd19 disabled )
PD20: (in out lcd_hsync spi0_clk reserved reserved eintd20 disabled )
PD21: (in out lcd_vsync spi0_miso reserved reserved eintd21 disabled )
PE0: (in out csi_hsync lcd_d0 twi2_sck uart0_rx einte0 disabled )
PE1: (in out csi_vsync lcd_d1 twi2_sda uart0_tx einte1 disabled )
PE2: (in out csi_pclk lcd_d8 clk_out reserved einte2 disabled )
PE3: (in out csi_d0 lcd_d9 da_bclk rsb_sck einte3 disabled )
PE4: (in out csi_d1 lcd_d16 da_lrck rsb_sda einte4 disabled )
PE5: (in out csi_d2 lcd_d17 da_in reserved einte5 disabled )
PE6: (in out csi_d3 pwm1 da_out owa_out einte6 disabled )
PE7: (in out csi_d4 uart2_tx spi1_cs reserved einte7 disabled )
PE8: (in out csi_d5 uart2_rx spi1_mosi reserved einte8 disabled )
PE9: (in out csi_d6 uart2_rts spi1_clk reserved einte9 disabled )
PE10: (in out csi_d7 uart2_cts spi1_miso reserved einte10 disabled )
PE11: (in out clk_out twi0_sck ir_rx reserved einte11 disabled )
PE12: (in out da_mclk twi0_sda pwm0 reserved einte12 disabled )
PF0: (in out sdc0_d1 dbg_ms ir_rx reserved eintf0 disabled )
PF1: (in out sdc0_d0 dbg_di reserved reserved eintf1 disabled )
PF2: (in out sdc0_clk uart0_tx reserved reserved eintf2 disabled )
PF3: (in out sdc0_cmd dbg_do reserved reserved eintf3 disabled )
PF4: (in out sdc0_d3 uart0_tx reserved reserved eintf4 disabled )
PF5: (in out sdc0_d2 dbg_ck pwm1 reserved eintf5 disabled )
root@f1c100s:~#gpio dumpall
PA:
GPIO_CFG0: 0x00001170
GPIO_CFG1: 0x00000000
GPIO_CFG2: 0x00000000
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000008
GPIO_DRV0: 0x00000055
GPIO_DRV1: 0x00000000
GPIO_PUL0: 0x00000000
GPIO_PUL1: 0x00000000
PB:
GPIO_CFG0: 0x00007222
GPIO_CFG1: 0x00000000
GPIO_CFG2: 0x00000000
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000000
GPIO_DRV0: 0x00000055
GPIO_DRV1: 0x00000000
GPIO_PUL0: 0x00000000
GPIO_PUL1: 0x00000000
PC:
GPIO_CFG0: 0x00002222
GPIO_CFG1: 0x00000000
GPIO_CFG2: 0x00000000
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000000
GPIO_DRV0: 0x00000000
GPIO_DRV1: 0x00000000
GPIO_PUL0: 0x00000000
GPIO_PUL1: 0x00000000
PD:
GPIO_CFG0: 0x22222222
GPIO_CFG1: 0x22222222
GPIO_CFG2: 0x00222222
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000000
GPIO_DRV0: 0x55555555
GPIO_DRV1: 0x00000555
GPIO_PUL0: 0x00000000
GPIO_PUL1: 0x00000000
PE:
GPIO_CFG0: 0x71011155
GPIO_CFG1: 0x00033177
GPIO_CFG2: 0x00000000
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000478
GPIO_DRV0: 0x01555555
GPIO_DRV1: 0x00000000
GPIO_PUL0: 0x00000004
GPIO_PUL1: 0x00000000
PF:
GPIO_CFG0: 0x00222222
GPIO_CFG1: 0x00000000
GPIO_CFG2: 0x00000000
GPIO_CFG3: 0x00000000
GPIO_DATA: 0x00000000
GPIO_DRV0: 0x00000aaa
GPIO_DRV1: 0x00000000
GPIO_PUL0: 0x00000555
GPIO_PUL1: 0x00000000
wuxx 说:我也做了个多功能编程器,实际上就是块树莓派扩展板,可以烧录SWD、JTAG、ICSP 接口的单片机,以及SPI-FLASH和I2C-EEPROM。
https://www.muselab-tech.com/ghost/#/editor/post/5c9f341f1dd38200011a44ed
软件全部开源(本来也都是开源软件),大家可以试用一下要登录,账号密码呢
我也做了个多功能编程器,实际上就是块树莓派扩展板,可以烧录SWD、JTAG、ICSP 接口的单片机,以及SPI-FLASH和I2C-EEPROM。
https://www.muselab-tech.com/ghost/#/editor/post/5c9f341f1dd38200011a44ed
软件全部开源(本来也都是开源软件),大家可以试用一下
一般用jlink也就是下载和单步调试吧,jscope等高级功能应该用的人还是少,不如试试cmsis dap,价格也就二三十块,而且软件是开源的,支持jtag, swd, 虚拟串口,以前用过技小新出的18块一个,后来技小新倒闭了,不如试试这个,感觉还可以 :)
https://item.taobao.com/item.htm?spm=a230r.1.14.70.1a0b7667FLLsM1&id=578885646940&ns=1&abbucket=2#detail
页次: 1