Comments (3)
I have the same XTW2 with the GD32F103 and I'm getting the same issues as you. From what I can find online about the GD32F103 I think this might be an issue with libopencm3 rather than vserprog.
On my board, the power LED is connected directly to the ASM1117 and doesn't need any code from the xtw100 to make it work.
I'm not really sure where to begin with debugging this on the GD32 but if anyone has any ideas, I'm happy to flash them to the XTW2 and test.
from stm32-vserprog.
So the GD32F103 is a bit weird when it comes to clock setup, and neither the stock STM32 clock config nor the GD32F103 one that's present in the code in master actually works properly, as best I can tell. Have to set the clock to 96MHz and do some other weird stuff to make USB work 100% right & get the APB2 clock set to the correct speed.
I've patched that up a bit (based on reading the latest datasheet from here and staring at the example code, plus this helpful blog post and its associated github repo) and you'll find that in my fork over here
I fired up debugging via Cortex Debug and an ST-Link v2 clone adapter, and regardless of whether the legacy code or the DMA code gets used for SPI transfers, sends work fine but receives all hang waiting for the SPI_SR_RXNE bit to clear (or the DMA 'transfer complete' interrupt to fire)
I don't have enough of a clue about how this whole deal works to actually debug it, but if anyone's got ideas i'm all-ears. Apparently the code in the github repo I mentioned above works just fine for doing SPI transmits and receives - even at 54MHz SPI clock 😮 - so it must be something to do with the full-duplex-mode setup, possibly software slave control issues?
from stm32-vserprog.
I take it back, I do apparently have some clue about how this whole deal works 😝
So the problem is twofold; clock configuration on one end, and the GD32F103 absolutely refusing to work with software slave select, at least with the way this firmware implements it. It throws a CONFERR no matter how I try to tweak things and just refuses to play ball.
If, however, I turn off software slave select, it works just fine, even at (what should be) 48MHz SPI clock.
Benchmark with the old CPU copying routine:
Detecting flash...
Generating test file...
Erasing...
Verifying... PASS
Writing...
Reading...
Comparing...PASS
Flash type: MX25L6406E/MX25L6408E
Flash size: 8192 KiB
SPI speed : 50000000 Hz (requested)
Probe : 1.00s
Erase : 170.66s
Write : 207.30s
Read : 83.53s
And with DMA enabled:
Detecting flash...
Generating test file...
Erasing...
Verifying... PASS
Writing...
Reading...
Comparing...PASS
Flash type: MX25L6406E/MX25L6408E
Flash size: 8192 KiB
SPI speed : 50000000 Hz (requested)
Probe : 1.00s
Erase : 101.66s
Write : 60.43s
Read : 10.78s
So that's nice. What's the downside of using hardware NSS control? Seems like it should be fine to me?
Anyway, I've pushed the functional (as far as I can tell) code to my fork over here - clone and make BOARD=xtw2
should do it. Will try to clean the commits up and maybe submit a PR soon :)
from stm32-vserprog.
Related Issues (20)
- Cosmic/18.04: Had to install libnewlib-arm-none-eabi to resolve stdint.h not found error. HOT 1
- How to use udev rules to make a symbol link of /dev/ttyACM<N> HOT 2
- 这个编程器可不可以有安卓app上位机程序呀? HOT 1
- stm32-vserprog-v3板子上的写保护功能怎么用呀?具体作用是? HOT 1
- How to connect a 25 type SPI Flash to the board's DIP-8 slot ? where can find the schematics? HOT 1
- 按照原理图做了一个V3的版本,测试25 SPI读取速度有点慢,不知道哪里出问题了 HOT 1
- Unable to get past make BOARD=stm32-bluepill HOT 2
- 赞,blog.dword1511.info无法评论,只有在这里评论了,附带一些文件下载地址 HOT 1
- 几个问题,望回复 HOT 4
- 如果能用STM32F103vct6 将nand 和spi 都支持就好了 HOT 1
- support for REVELPROG IS board
- 关于针对W25Q256FV的4Byte地址模式的支持 HOT 6
- flashrom Git URL needs updating HOT 1
- Any recommended hardware? HOT 1
- stm32-bluepill failed to init device HOT 2
- Works fine on MacOS (M1 Mac)
- MT25QL512 HOT 1
- Nucleo F411RE: more than header config?
- 有编译好的吗blachpill上用
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm32-vserprog.