-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to flash with dfu-util #5
Comments
That's strange. Have you already flashed different examples with this dfu-util method? Did it work? |
Hmm, using |
I tried blinky too but I was not sure if an actual led should blink or just a pin. If a led on the board itself should blink, then it has the exact same broken behavior as display. |
That is interesting. I use the one from the Archlinux Repo. But I used it two days ago with another Rust code (not from this repo, I cannot remember from where it was) and it worked flawlessly. |
Try this one: https://github.com/riscv-mcu/gd32-dfu-utils |
This one has (from the master branch) the same result but has a slightly different output (both, display and blinky)
The lines with the Device Model does not appear in the Arch's one. |
Maybe the outputs of
|
Try getting your firmware back with the |
I have uploaded it without the |
I've just built https://github.com/riscv-mcu/gd32-dfu-utils from master and And
I have GD32VF103C8 on my board though, not GD32VF103CB. |
That is because in my case
This is the output from I own five of the Longan Nano, I tried a second one which has the exact behavior (including every step of this issue) and just has devnum=25 if that is device specific. |
I can confirm that on my longan nano, with the dfu-util from: |
Ok that is strange. Which board do you exactly have? What prints |
I have a longan nano (GD32VF103CBT6). I run dfu-util --list, with the dfu-util package I linked above:
However, flashing works perfectly so far. DFU Device ID: 28e9:0189 OS: Manjaro Linux 5.4.18-1, same tools worked on windows 10. Do you use the GD32 dfu-utils? |
You have to run that as root. Yeah but I compiles them for myself as mentioned above. |
doh. Of course. It says: Found DFU: [28e9:0189] ver=1000, devnum=16, cfg=1, intf=0, path="3-4", alt=1, name="@option Bytes /0x1FFFF800/01016 g", serial="3CBJ" What happens when you try the official compiled utils? Is the point of this issue that it does not work with your custom compiled dfu-util? |
I see one major difference with the @eiskasten's board 8c8,9
< Found DFU: [28e9:0189] ver=0100, devnum=24, cfg=1, intf=0, path="2-12", alt=0, name="@Internal Flash /0x08000000/128*001Kg", serial="3CBJ"
---
> Found DFU: [28e9:0189] ver=1000, devnum=17, cfg=1, intf=0, path="2-4.1.3", alt=1, name="@Option Bytes /0x1FFFF800/01*016 g", serial="3CBJ"
> Found DFU: [28e9:0189] ver=1000, devnum=17, cfg=1, intf=0, path="2-4.1.3", alt=0, name="@Internal Flash /0x08000000/512*002Kg", serial="3CBJ" That board reports |
Question, I have two of the Longan nano boards [purchased the week Seeedstudio first started selling them. Can the bootloader be updated, should I just buy some new ones and save me the trouble. |
Why is |
Actually, I think maybe you use a wrong RISC-V GNU Toolchain (riscv-none-embed-objcopy), and this works for me which comes from NUCLEI (Official GD32 Core Designer) https://www.nucleisys.com/download.php riscv-none-embed-objcopy -O binary target/riscv32imac-unknown-none-elf/release/examples/display display.bin |
I've tried it today, it does not make any difference. Btw, does anybody now know how to fix that?:
|
@eiskasten I'm not sure that you can fix this. Looks like you have a different bootloader which doesn't support |
Obtaining a JTAG adapter is a little bit compilcated as my country is locked down due to COVID-19, maybe it is possible to order one online. Now I have tried https://github.com/WRansohoff/GD32VF103_templates (but it is in C instead of Rust) and the hello_led example works for me, although I had to replace every |
@eiskasten as an alternative, you can use Windows flashing tool from Nuclei. I don't know the details, but people reported that it works for these chips. |
Ok I will look for an Windows machine, but isn't my linked repo the proof that that is no flashing problem? |
This example can fit in the first ~512 bytes and work because of that. Try flashing a bigger one. |
So you think that this problem is bootloader/size related? Do you think this might help? https://mecrisp-stellaris-folkdoc.sourceforge.io/gd32vf103.html#flashing-the-mecrisp-quintus-binary |
Hmm, it could help. Worth a try! |
Hello, just to add one more datapoint: I'm having the same problem with my longan-nano, which also reports only the @INTERNALflash section. I'm not having any trouble downloading & running the rust example from https://github.com/pcein/rust-sipeed-longan-nano with either dfu-util, but when I try to download the examples from this repository it fails. I can confirm that when uploading and diffing the small binary from that repository, there are no differences. Uploading and diffing the bigger binaries from this repository here, I do get differences. Using the patched dfu-util from https://github.com/riscv-mcu/gd32-dfu-utils does not help for me. |
You are most likely to have the GD32VF103CB instead of the GD32VF103C8 device too, which nearly nobody seems to own. However, I found this guy on reddit which has the same problem too but unfortunately, this bug in the bootloader does not seem to be get ever fixed and according to Seeed, it is not possible to patch the bootloader. I also have only differences when using bigger binaries and the patched version does not make any difference to this behavior. |
@eiskasten Correct, I do have the GD32VF103CB. But I just got the display example to work! a) The most recent upstream version of dfu-utils (as of May 2nd 2020) contains a workaround for the buggy bootloader (https://sourceforge.net/p/dfu-util/dfu-util/ci/master/tree/). Down- and uploading binaries still gives me a b) Now I realised that the binary I was writing started with a bunch of 0x00 at 0x8000000 -- which seemed odd. I tried different Downloading that then actually worked! I do see a "Hello Rust!" with green background on my display now! Update: I was using rust-objcopy from rust llvm-tools before. |
Confirmed! Works without problems now (beside the |
Since the problem is kinda solved and described in README, I think we can close the issue. |
I wanted to test the display example. But it does not seem to work.
Steps to reproduce:
cargo build --release --example display --features=lcd
output:
As I have connected the Sipeed Longan Nano via USB-C, I had to
dfu-util
to flash the binary which must be converted before:riscv-sifive-elf-objcopy -O binary target/riscv32imac-unknown-none-elf/release/examples/display display.bin
A file with ~23K size is the result. The next step was to put the Sipeed Longan Nano into flash mode and flash the bin file:
sudo dfu-util -s 0x08000000:leave -D display.bin
which outputs:
When completed, the Sipeed Longan Nano resets and is not in flashmode anymore.
During the whole process including flashmode, flashing and running the program, the red led next to the boot button is on and the backlight of the display too but all pixels remain black and never change their color which is not expected as it should display
Hello Rust!
when the program is running.I do not use openocd as I do not know how to use it as I do not own a JTAG adapter. I only own a USB UART adapter but I think it is not possible to use that instead.
The text was updated successfully, but these errors were encountered: