Closed particlerain closed 1 year ago
Hi,
The choice for A. BKPSRAM or B. SPI flash ROM is defined in the make file: A. https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/gd32_emac_artnet_dmx_multi/Makefile.GD32#L18 B. https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/gd32_emac_artnet_dmx_multi/Makefile-dmx4.GD32#L18
It is on my To-Do list providing the firmware for all options. But as this is all an one-man-show, working in free time, it will take some time.
Hi again, I tried with a 3.3V battery (not rechargeble / CR2032) on VBAT, but it was not able to save the config. I also had a W25Q32 laying around here and used the v1.3 Artnet Multi DMX4 bin file (Its SPI as you mentioned), but was also not able to save the changes. I connected the CS pin to PA15 like shown on your board. Or do i have to uıse the W25Q128?
tried with a 3.3V battery (not rechargeble / CR2032) on VBAT, but it was not able to save the config.
Are you using my development board? If so, then please be sure you are using a rechargeable LIR battery.
I have tested the battery backed-up RAM (BKPSRAM) with my development board and a LIR2032, and that is working fine for me.
I connected the CS pin to PA15 like shown on your board.
When using the generic DMX 4 configuration then the SPI FLASH /CS is PB1 -> https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/lib-gd32/include/board/dmx4.h#L161
The W25Q32 (https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/lib-flash/src/spi/winbond.cpp#L92) should work fine, however I have not tested it.
Are you using my development board?
No, just a breadboardish design for now.
Edit: Found a rechargable battery. And it works great! Sorry for asking but why does the rechargable one works and not the normal battery? Just curious because it did not make sense to me...
When using the generic DMX 4 configuration then the SPI FLASH /CS is PB1 -> https://github.com/vanvught/GD32F407RE-DMX512-RDM/blob/main/lib-gd32/include/board/dmx4.h#L161
Which SPI port and pins are you using for the Winbond flash? I am using PB3-PB4-PB5. Is this correct?
Found a rechargable battery. And it works great! Sorry for asking but why does the rechargable one works and not the normal battery? Just curious because it did not make sense to me...
Good to hear that it is working. No worries. I am happy to receive feedback. I haven no idea as well why a normal battery is not working.
The VBAT is also used for the internal RTC. However, I am not using the RTC, yet. The RTC can be used for scheduling a pre-programmed show running from USB flash.
Thank you.
The VBAT is also used for the internal RTC. However, I am not using the RTC, yet. The RTC can be used for scheduling a pre-programmed show running from USB flash.
I do look in the source code as much as i can, and yes i noticed you did not activate the RTC. Thanks for the info. Good to know it can be used for scheduling though. Thats a cool implementation.
Btw, for a one-man-work and just in your free time, you did a industry standard great professional work. I was tired of bad coded open source artnet interfaces including my own codes and looks like you took over the game ;) Congrats for that and thank you so much for taking time for us.
Edit: still testing spi flash before asking..
When flashing the bootloader then make sure that only the first 32KB flash is erased.
˜˜The bootloader for dmx4 https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/blob/main/bootloader-tftp/Makefile-dmx4.GD32 has support for console output on USART0. ˜˜
Correction: CONSOLE_I2C is enabled -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/blob/main/firmware-template-gd32/Rules.mk#L37
First 32kb erase on the ws25qxx?
First 32kb erase on the ws25qxx?
No, the GD32F flashrom. Per default the GD32F flash util erases the complete flash. There is an option: Erase used only.
You can always get in the bootloader with bringing KEY_BOOTLOADER_TFTP_GPIO_PINx to low during reset -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/blob/main/lib-gd32/include/board/dmx4.h#L85
i tested the ws25q32 on arduino and it reads writes well. I am able to get in the bootloader with the standart bootloader bin file which uses teh BSRAM. See:
No display found [V1.3] GD32F407RE Compiled on Nov 1 2022 at 14:57:08 Bootloader TFTP Server FMC: Detected GD32F407RE with total 524288 bytes [512 kB] GD32F407RE, sector size 16384, 524288 bytes [512 kB] BSRAM: Detected GD32F407RE with total 4096 bytes [4 kB] Network Hostname : gigadevice_472B14 IfName : 1: eth0 Inet : 192.168.0.112/24 Netmask : 255.255.255.0 Gateway : 192.168.0.1 Broadcast : 192.168.0.255 Mac : 02:35:32:47:2b:14 Mode : D
But after i flash the dmx4 with SPI support, the bootloader does not boot. Nothing in the UART terminal. I also tried the KEY_BOOTLOADER_TFTP_GPIO_PINx (in this case A11) to force it , but doesnt work.
No, the GD32F flashrom. Per default the GD32F flash util erases the complete flash. There is an option: Erase used only.
I don't understand this. Don't we have to put the bootlader on to an empty fully erased chip? I am using ST-link adaper to flash the device. There is only full or sector erase possible. I tried to erase the first two 16KB sector. And that did not help either.
I've successfully tested the dmx4 bootloader before publishing on GitHub. Currently, I do not have access to GD32F407 boards. I will make a setup tomorrow.
Well it turned out that the dmx4 bootlader binary you provided does not work here.
One question: do i have to use the bootloader also with the SPI compiled if i wanna use the firmware compiled with SPI or can i use the bootloader compiled with RAM and firmware with SPI?
Because now i use bootloader v1.2 and firmware with SPI , and it can detect the ws25q32 and somehow i can store settings. But sometimes after power on off , the settings come back as garbage. And the device will get a 129.x.y.z ip. I thought maybe its because of the spi speed and spi_flash_internal.h and lowered it to 1mhz . Testing right now.
What really is a problem for me is that sometimes when i press just the reset button the device will jump to the bootloader, so i have to press reset again a couple of times. I already put the 1.5k resistor to A11, but it still happens. Do you have an idea what causes this? Does this happens to you too?
I have just checked the Rules.mk and CONSOLE_I2C is enabled -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/blob/main/firmware-template-gd32/Rules.mk#L37 Hence there is no USART0 output.
Do you have an idea what causes this? Does this happens to you too?
No. There an internal pull-up which will do the job -> https://github.com/vanvught/GD32F407RE-Bootloader-TFTP/blob/main/bootloader-tftp/firmware/main.cpp#L64
One question: do i have to use the bootloader also with the SPI compiled if i wanna use the firmware compiled with SPI or can i use the bootloader compiled with RAM and firmware with SPI?
It must match. Otherwise the settings made in the firmware are not the same as with the bootloader.
It must match. Otherwise the settings made in the firmware are not the same as with the bootloader.
Well then, i also compiled the bootloader with SPI, but compilatons with SPI defined disables the bootloader from booting. I would be happy if you can test this issue when you have your setup ready.
This is the bootloader with SPI flash support and with USART0 output.
This one worked. Its booting and spitting on usart0. Also detecting the ws25xxx.
Why not my compilation though? I thought just defining in the Makefile.gd32: CONFIG_STORE_USE_SPI should be enough?
Hey Arjan,
After i flashed your bin file with spi & usart0 support, it worked fine but now when i flash a different bootlader (also your bin v1.2 or v1.3 ) i can not start the tftp server anymore and can not flash the firmware. On terminal i get ARP lookup failed message. I did not change anything in the hardware. I dont know why this happens. Any idea?
Edit: Solved by deleting arp cache with arp-d. Also attached stable 3.3v supply.
Hi Arjan, Everything fine so far. Got some issues though: 1- After configuring the network.txt with a static IP and dhcp=0 & save it, and after pushing the reset button it is updating the IP and it works fine, but it looses the static IP settings and turns back to DHCP mode and gets again it's IP from the DHCP pool after powering the device on or after a power surge. In my setup i need to work only with static IP's. So how to make the device stuck to a static IP? Are the settings not stored in the eeprom?
2- The device is not accepting the reboot command from the remote configuration manager. But it is accepting it from the Firmware update UI. So i have to reboot the device manually through the reset button. What can cause this?
edit: well i could reserve an IP on the router side for that mac, but sometimes i just need to plug it on the PC's network card, and acces it directly with it's static IP.
Thanks.