3185 views|14 replies

392

Posts

0

Resources
The OP
 

How to use SPI with stm32F429 connected to W5500? [Copy link]

 

Use stm32f429's SPI5 to connect to W5500 and call the SPI5's DMA channel

Set as server and PC as client.

The program uses the officially downloaded driver, which has been modified to support DMA.

In terms of configuration, the SPI configuration is the default configuration of cubemx, 4 division (22.5M), all SPI pins have no pull-up or pull-down, and the speed level is the fastest. DMA is in normal mode (non-circular mode).

The server can be connected to by the client, and there are no problems in sending and receiving dozens of bytes of data. It can read and write registers, etc.

According to the protocol, the PC sends a file to the server for storage. It sends a frame of data, and the server returns a frame of ACK, one by one. In this process, a problem occurred. The waveform captured by the oscilloscope is as follows

Red is MOSI, yellow is MISO, green is CLK, and blue is one of my trigger signals.

The problem is that in the long level area of MISO, the MCU is reading the cache data of W5500, and MISO should be output, but at this time, it is not output, and the level is not low, but an intermediate level, and MOSI is also an intermediate level and cannot be pulled low.

I have tried configuring the pins to pull up and down in the software, but it didn't work and the phenomenon was the same.

I checked the program and found that there is no other configuration for these SPI5 pins. I used the TCP debugging tool to send it and randomly selected a frame of data. The same phenomenon still occurred at the 59th frame. But not all frames are in this frame.

Jumper, use the SPI3 pin, jumper to the W5500, and the problem does not occur.

I have several boards with the same problem. Is there any problem with the SPI5 of F429?

This post is from stm32/stm8

Latest reply

Hello, I am also working on f429dma w5500 recently. Can you share a software reference? Thank you very much.  Details Published on 2023-11-12 22:55
 

1668

Posts

0

Resources
2
 

Check if the power supply voltage meets the standard value. If
the client or server that establishes a connection with W5500 detects that the sent data is illegal, it will disconnect automatically.

It is recommended to use the network debugging assistant to confirm whether the sent data is illegal.

This post is from stm32/stm8
 
 

392

Posts

0

Resources
3
 

The connection is not disconnected. After reading these 1050 bytes, the register is read and written again, and the returned value is correct. The next frame can be read. From the packet capture by Wireshark, the data sent is also correct.

The voltage of W5500 captured at this moment has relatively small ripple and no sudden change.

This post is from stm32/stm8
 
 

5221

Posts

239

Resources
4
 

I shared your question in our evaluation group. I will share the following suggestions from two group members for your reference:

1、spi最好是使用前两个,鬼知道后面几个是不是有啥bug,一般情况下PA4-PA7不要接别的元器件,预留给SPI用,我甚至遇到过SPI2跟串口3的DMA接收起冲突...ST的东西,最好是别整花活,不然排查问题影响效率,串口和SPI都用前两个,I2C用第一个,PB6 PB7

2. I suspect it is a DMA conflict.

This post is from stm32/stm8
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

The problem was found. There was an SPI FLASH on the development board, which used these 4 pins. There was competition. When laying out the board, I didn't pay attention to the IO pins on the development board.  Details Published on 2022-11-16 19:10
 
 
 

392

Posts

0

Resources
5
 
nmg Published on 2022-11-16 16:34 I shared your question in our evaluation group. I will share the suggestions given by two group members for reference: 1. It is best to use the first two for spi. Who knows...

The problem was found. There was an SPI FLASH on the development board, which used these 4 pins. There was competition. When laying out the board, I didn't pay attention to the IO pins on the development board.

This post is from stm32/stm8

Comments

This mistake is so difficult  Details Published on 2022-12-1 16:37
nmg
This mistake is so difficult  Details Published on 2022-11-17 11:04
 
 
 

5221

Posts

239

Resources
6
 
Madai published on 2022-11-16 19:10 The problem was found. There is an SPI FLASH on the development board, which uses these 4 pins. There is competition. When the board was laid out, no attention was paid...

This error is so difficult, how did you find it?

This post is from stm32/stm8
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

A colleague mentioned it, and when we checked the core board, we found the IC. We had been checking our own source code, SCH and PCB, but we couldn't find it. It was probably our own negligence.  Details Published on 2022-11-17 11:18
A colleague mentioned it, and when we checked the core board, we found the IC. We had been checking our own source code, SCH and PCB, but we couldn't find it. It was probably our own negligence.  Details Published on 2022-11-17 11:16
 
 
 

392

Posts

0

Resources
7
 
nmg posted on 2022-11-17 11:04 This error is so difficult, how did you find it out?

A colleague mentioned it, and when we checked the core board, we found the IC. We had been checking our own source code, SCH and PCB, but we couldn't find it. It was probably our own negligence.

This post is from stm32/stm8
 
 
 

392

Posts

0

Resources
8
 
nmg posted on 2022-11-17 11:04 This error is so difficult, how did you find it out?

Because it is not always wrong, most of the data transmission and reception are correct, and I have checked the program for a long time. Maybe in some data frames, it just happens to encounter some command ICs of this SPI FLASH.

This post is from stm32/stm8
 
 
 

11

Posts

0

Resources
9
 
提示: 作者被禁止或删除 内容自动屏蔽
 
 
 

224

Posts

0

Resources
10
 

Awesome, learned from the masters

The Taobao order I just placed includes the W5500 module development board. I hope I can learn this soon.

This post is from stm32/stm8

Comments

Come on, come on  Details Published on 2022-12-5 13:17
 
 
 

392

Posts

0

Resources
11
 
starcat123 posted on 2022-12-1 16:37 Awesome, I learned from the big guy. The Taobao order I just placed has the W5500 module development board. I hope I can learn this soon.

Come on, come on

This post is from stm32/stm8
 
 
 

6069

Posts

4

Resources
12
 
This post was last edited by damiaa on 2022-12-15 10:15

429 is better with its own Ethernet, it is not so convenient to hang a w5500.

WIZnet released w5500 and w7500 but didn't release any new ones. I don't know why. Logically, w7500 would have a wider range of applications if it had more memory.

On the contrary, the domestic situation is getting better and better.

This post is from stm32/stm8

Comments

Well, we have a requirement of 4 network ports, so we still need an external plug-in.  Details Published on 2022-12-19 13:38
 
 
 

392

Posts

0

Resources
13
 
damiaa posted on 2022-12-15 10:12 429 is better with its own Ethernet. It is not so comfortable to hang a w5500. WIZnet has not made any new ones since it released w5500 and w7500. I don't know...

Well, we have a requirement of 4 network ports, so we still need an external plug-in.

This post is from stm32/stm8
 
 
 

1

Posts

0

Resources
14
 
Madai published on 2022-12-19 13:38 Well, we have a requirement for 4 network ports, so we still have to use an external plug-in

Hello, I am also working on f429dma w5500 recently. Can you share a software reference? Thank you very much.


This post is from stm32/stm8

Comments

I'm sorry that I didn't simplify the company's program. But this is not very difficult. At that time, both SPI DMAs came out, and the other one just had problems occasionally, which took a long time to troubleshoot.  Details Published on 2023-11-13 11:00
 
 
 

392

Posts

0

Resources
15
 
W1234w posted on 2023-11-12 22:55 Hello, I am also working on f429dma w5500 recently. Can you share a software reference? Thank you very much

I'm sorry that I didn't simplify the company's program. But this is not very difficult. At that time, both SPI DMAs came out, and the other one just had problems occasionally, which took a long time to troubleshoot.

This post is from stm32/stm8
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list