Skip to content
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

Bootloader can't get IP from DHCP Server #2

Closed
particlerain opened this issue Nov 13, 2022 · 18 comments
Closed

Bootloader can't get IP from DHCP Server #2

particlerain opened this issue Nov 13, 2022 · 18 comments
Labels
help wanted Extra attention is needed

Comments

@particlerain
Copy link

particlerain commented Nov 13, 2022

So i bought a GD32f407RE. Flashed the bootlader v1.3 with ST-Link adapter to the adress 0x08000000. I am using DP83848 Phy. The router is assigning the IP from DHCP, but for a short time. Also there is no ping response. In the meantime, i can see the device in the Firmware Update Manager, but with an ip in the range of 169.x.x.x. And after 10-15sec the device dissapears in the router as well. By the way the PC0 LED is blinking in 500ms intervals. What does that mean? Can you help?
Also does the firmware only works by uploading it through the bootloader or can i flash it directly? If yes, what are the network settings for your firmware release? DHCP or Static IP?
Thanks.

@particlerain
Copy link
Author

particlerain commented Nov 13, 2022

Unfortunately there is a documentation missing for the board and the functionality of the code to get starting. :( I also tried the OPI zero , that one works like a charm btw.

@vanvught vanvught added the help wanted Extra attention is needed label Nov 13, 2022
@vanvught
Copy link
Owner

There is documentation here -> https://www.gd32-dmx.org

The readme here -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP tells that the bootloader must be loaded and then the firmware at 0x08007000. You can install the initial firmware also with the GD32 tools ( http://www.gd32mcu.com/en/download/7?kw=GD32F4) or when the KEY_BOOTLOADER_TFTP_GPIO_PINx is pressed during reset, the Java UI can be used.

i can see the device in the Firmware Update Manager, but with an ip in the range of 169.x.x.x.

The 169.254.x.y is ZeroConfig and enabled when DHCP is not working ->https://www.orangepi-dmx.org/orange-pi/network-configuration/ethernet

By the way the PC0 LED is blinking in 500ms intervals.

The firmware is running.

the network settings for your firmware release? DHCP or Static IP?

Default is DHCP

@vanvught
Copy link
Owner

With exception for the firmware with 4x RDM/DMX, you can use USART0 for debugging -> https://www.gd32-dmx.org/dev-board.html

@vanvught
Copy link
Owner

I also tried the OPI zero , that one works like a charm btw.

The GD32 firmware is exactly the same as the OPi firmware functionality.

@particlerain
Copy link
Author

Thank you for your time & answer.
I don't see a reason why it is not connecting via DHCP. I am using the DP83848 also with stm32f407 and there is no problem. Although i use it there with static ip.
Since i can not compile the whole library for now because i don't have eclipse installed and i am not familiar with the GD32 device, is there a chance you can make for me a gd32f407re binary with a static ip? So i can see if it is a hardware or network problem. That would be the easiest way for me to troubleshoot the device now. On OPI, i can make changes to network via the network.txt file. But here i am stuck.

@vanvught
Copy link
Owner

Since i can not compile the whole library for now because i don't have eclipse installed and i am not familiar with the GD32 device, is there a chance you can make for me a gd32f407re binary with a static ip?

No need to compile the firmware.

On OPI, i can make changes to network via the network.txt file.

The configuration can be done with (same as with the OPi):

  1. Human readable UDP messages -> https://www.orangepi-dmx.org/orange-pi/remote-configuration-management-for-spi-flash
  2. The sample Java UI -> https://github.com/vanvught/Remote-Config-UI/releases/tag/V19
  3. RNC -> https://github.com/hippyau/rnc

@vanvught
Copy link
Owner

i don't have eclipse installed

No need to install Eclipse CDT. You can just work with the make file.

@particlerain
Copy link
Author

particlerain commented Nov 13, 2022

The configuration can be done with (same as with the OPi):

1. Human readable UDP messages -> https://www.orangepi-dmx.org/orange-pi/remote-configuration-management-for-spi-flash

2. The sample Java UI -> https://github.com/vanvught/Remote-Config-UI/releases/tag/V19

3. RNC -> https://github.com/hippyau/rnc

Since i am not able to get an dynamic IP from the device, i can not use the above solutions to change to static IP. I tried also rnc now and it is not able to detect the device. The rnc app is stuck on "Searching please wait".
The device is there in the firmware update window but as i said with an 169.x.x.x IP. And for example if i try to read the version from Action->version it comes with : "169.254.71.43 Bootloader TFTP , #Error - Timeout" message. I also can NOT turn on the TFTP server of course. I am out of ideas.

@particlerain
Copy link
Author

Ok so i finally managed the device to obtain an IP adress and flashed the firmware. So everything is fine.
What i did: I just tried another router and it worked.
Thanks so much for your help and your great work!

@vanvught
Copy link
Owner

What i did: I just tried another router and it worked.

What would be different with this other router?

@particlerain
Copy link
Author

particlerain commented Nov 15, 2022

What i did: I just tried another router and it worked.

What would be different with this other router?

At the moment i really have no idea.
The one that not worked, is my new router for my fiber internet. Upon connecting the gd32 device to one of my old routers it got the ip assigned. Need to look more deeper to the fiber router settings.

Edit: Of course, both routers have the DHCP enabled and their IP is 192.168.0.1

@vanvught
Copy link
Owner

At the moment i really have no idea.

I am happy to look at Wireshark captures for the DHCP process.

@particlerain
Copy link
Author

I noticed that the router which does not assigns an ip uses DHCPv6. Could this be a reason?
I will send you later the wireshark capture too.

@particlerain
Copy link
Author

Hi Arjan,

Happy weekend.

Unfortunately i have difficulties with uploading the firmware through the TFTP server.
The TFTP server starts sometimes and sometimes not. And when it starts, the UDP file transfer will fail with "receive timed out" error message.
I spent now so much time on this and don't wanna give up. I wish there was a way to flash the firmware through SWD on the chip without dealing with UDP and TFTP.

The readme here -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP tells that the bootloader must be loaded and then the firmware at 0x08007000.

I tried as you mentioned to first flash the bootloader at 0x08000000 (the bootloader works fine btw.) and then the firmware to 0x08007000 through SWD, but that does not work for me. The firmware will not start.
Could you please give me some tips on how to flash the firmware without the TFTP server but with SWD?
Thank you for taking time.

Note: Where can i buy the PCB's for GD32F4xx board? Do you have some?

@vanvught
Copy link
Owner

Note: Where can i buy the PCB's for GD32F4xx board? Do you have some?

I have all the files ready for ordering at JLCPCB. I've just ordered a new batch with the SPI flash on the PCB. I will publish the files as soon as I received the boards and tested successfully.
Where do you live? When in Europe, it is worthwhile sending to you. Otherwise, it is better when you order directly from JLCPCB.

@vanvught
Copy link
Owner

and then the firmware to 0x08007000

My apologies here, the firmware is at 0x08008000 -> https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/firmware-template-gd32/gd32f407re_flash.ld#L3

I do not have GD32-Link, therefore I do not use SWD. I flash the bootloader with USB UDF or USART0 (unfortunately on Windows only). Then I load the firmware with the TFTP server.

@particlerain
Copy link
Author

My apologies here, the firmware is at 0x08008000 ->

Omg, this solved the issue. Now i am able to flash the firmware with SWD too. And everything works fine. Thank you.

@particlerain
Copy link
Author

I've just ordered a new batch with the SPI flash on the PCB. I will publish the files as soon as I received the boards and tested successfully.

Oh, as i will use the board definetely with the spi flash, i better wait for the new board then. Hopefully the board test will run fine for you.
I don't live in the EU, so i will take the jlcpcb option then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants