This commit is contained in:
2024-10-14 18:24:47 +06:00
parent e35b1c0114
commit 3d1206af86
4 changed files with 5 additions and 3 deletions

View File

@@ -12,7 +12,9 @@ fw for a ch32v203 node w/ w5500 ethernet
- SPI DMA only works with [prescalers](https://git.hye.su/mira/ch32-node/src/branch/master/src/spi_dma.c#L140) 8 and 64?
- Also, for some reason it needs a ~50ms delay before configuring w5500 when compiled **with** `-O0`, not needed with `-Os`...
TODO: LA?...
idk...
![systick_dma](notes/2024-10-14-182212_1566x610_scrot.png)
## ~~previous (DNS Processing)~~
solved by [patching](https://git.hye.su/mira/ch32-node/commit/259d63197e06c1a92b979490d4cd8f0fdb98f8d0#diff-6ba50689ba55dac7cfe3e9b011e594098c931e21) the korean bloatlib (`dns_makequery` in DNS.c)

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@@ -53,7 +53,7 @@ int main(void) {
// TODO: enabling any kind of SysTick IRQ literally causes the socket to hang forever
// with 1ms interval the hang is on DHCP_ACK, on check_DHCP_leasedIP -> sendto() ARP req
// with 1s it happens somewhere on DNS req
init_systick();
// init_systick();
tim2_init();
// systick irq enable here would complete the DHCP configuration and hang on DNS..

View File

@@ -137,7 +137,7 @@ void init_spidma(void) {
SPI_DataSize_8b | // 8-bit data frame format
SPI_CPOL_Low | // Clock polarity
SPI_CPHA_1Edge | // Clock phase
SPI_BaudRatePrescaler_8 | // Baud rate prescaler
SPI_BaudRatePrescaler_64 | // Baud rate prescaler
SPI_NSS_Soft; // Software NSS management
// Enable TX and RX DMA