ec9dcc76f7f1751dc87b4d8f1e5e96ab858f0ce5
Squashed commit of the following: commit c3e1f696b4fbafb6dd30c6934e4c7c181562e055 Author: kuwoyuki <kuwoyuki@cock.li> Date: Sat Oct 12 20:43:12 2024 +0600 chore: spi dma commit d1e7df60be3e06ed85ce8639516e299085d3c72b Author: kuwoyuki <kuwoyuki@cock.li> Date: Sat Oct 12 15:14:11 2024 +0600 static dummies commit 81682428b471f825e3350e37aa74c373b46d4fef Author: kuwoyuki <kuwoyuki@cock.li> Date: Sat Oct 12 14:45:39 2024 +0600 dma works? commit 150c97a4b566712a502d8a2861a2dc0864324d61 Author: kuwoyuki <kuwoyuki@cock.li> Date: Sat Oct 12 02:07:39 2024 +0600 dma?
Registering W5500 callbacks...
Calling wizchip_init()...
Calling DHCP_init()...
W5500 VERSIONR: 0x04
Registering DHCP callbacks...
Calling DHCP_run()...
> Send DHCP_DISCOVER
DHCP message : 192.168.102.1(67) 311 received.
> Receive DHCP_OFFER
> Send DHCP_REQUEST
DHCP message : 192.168.102.1(67) 311 received.
> Receive DHCP_ACK
> Check leased IP - OK
Callback: IP assigned! Leased time: 10 sec
IP: 192.168.102.113
GW: 192.168.102.1
Net: 255.255.255.0
DNS: 192.168.102.1
Calling wizchip_setnetinfo()...
Calling DNS_init()...
Resolving domain name "hye.su"...
> DNS Query to DNS Server : 192.168.102.1
> Receive DNS message from 192.168.102.1(53). len = 21
> Partial DNS message: 11 23 81 82 00 01 00 00 00 00 00 00 03 68 79 65 00 00 00 02 73
DNS_run() failed, res = 0
w/ ch32v003fun
Partial DNS message:
11 23 81 82 00 01 00 00 00 00 00 00 03 68 79 65 00 00 00 02 73DNS_run() failed, res = 0
w/ WCH HAL (none-os).. I get a full response
Receive DNS message from 192.168.102.1(53). len = 56 Partial DNS message:
11 23 81 80 00 01 00 02 00 00 00 00 03 68 79 65 02 73 75 00 00 01 00 01 C0 0C 00 01 00 01 00 00 01 2C 00 04 68 15 33 7F C0 0C 00 01 00 01 00 00 01 2C 00 04 AC 43 B4 9AResult: 172.67.180.154
RCC_CTLR, GPIO Registers, SPIx_CTLR1 registers are identical
LA
ch32v003fun
00 00 34 11 27 01 00 00 01 00 00 00 00 00 00 03 68 79 65 00 00 00 02 73 75 00 00 00 00 01 00 01
- 32 bytes long
- (Post
68 79 65):00 00 00 02 73 75 00 00 00 00 01 00 01
none-os
00 00 34 11 27 01 00 00 01 00 00 00 00 00 00 03 68 79 65 02 73 75 00 00 01 00 01
- 27 bytes long
- (Post
68 79 65):02 73 75 00 00 01 00 01
none-os
// Initialize GPIO for W5500 CS
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = W5500_CS_Pin;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(W5500_CS_GPIO_Port, &GPIO_InitStructure);
// ...
static void MX_SPI1_Init(void) {
/* SPI1 parameter configuration*/
GPIO_InitTypeDef GPIO_InitStructure = {0};
SPI_InitTypeDef SPI_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; // SPI Mode 0 (CPOL=0, CPHA=0)
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; // SPI Mode 0 (CPOL=0, CPHA=0)
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(SPI1, &SPI_InitStructure);
SPI_Cmd(SPI1, ENABLE);
}
Description
Languages
C
97.6%
Assembly
2.1%
Makefile
0.3%

