2215 views|3 replies

409

Posts

7

Resources
The OP
 

[Distributed temperature and humidity acquisition system] + STM32H745I-LWIP debugging process [Copy link]

 This post was last edited by lansebuluo on 2022-7-15 22:45

To transplant the LWIP program with the operating system, I found some other posts on the Internet for transplantation. After the code was compiled, downloaded and run, the result was abnormal, so I had to debug the code.

I have no experience in debugging networks. After days of searching, I finally found a way. Although it is not working yet, I would like to share it with you in the hope of getting more discussions.

There are a lot of debugging codes in the LWIP protocol stack. How to enable it? Taking the STM32H745I-DISCO development board as an example, the process is explained.

 The first method is to use USART to print

First, redefine the printf function and then output the debugging print information. The development board comes with a virtual serial port, which is connected to the main control chip USART3.

Define the pins corresponding to the hardware peripheral USART3

Hardware initialization code

USART3 initialization code

Redefine the function fputc

After completing these, you can use the printf function, but where to output it? You can use the HyperTerminal tool to receive data through the serial port.

The second method uses the signal function of the development board and directly uses IAR's Terminal I/O to view and print information, which is very convenient.

Set the project option as shown below

At this point, in IAR debugging mode, select VIEW>>Terminal I/O from the menu bar to open the corresponding window. You must be in DEBUG mode to select this.

With these, only the printf function has output function, and the debugging switch of LWIP needs to be defined.

In the lwipopts.h file, define the DEBUG switch. If you want to debug a part, define the corresponding part as LWIP_DBG_ON

Through the above, you can see which part of your program has a problem. Once the problem is located, you still need to solve the problem yourself.

Here is part of the debugging code. This program locates the application to create a binary semaphore in api_msg.c and fails. I don't know why it fails. It should be related to some definitions of FreeRTOS and has not been resolved yet.

Problem location

PrjMain0713.rar

13.72 MB, downloads: 2

售价: 1 分芯积分  [记录]

This post is from DigiKey Technology Zone

Latest reply

Not bad   Details Published on 2022-10-11 14:04
 
 

6841

Posts

11

Resources
2
 

Through the above, you can see which part of your program has a problem. If the problem is identified, you still need to solve it yourself. It seems that the author has studied seriously and hopes to get started as soon as possible. Come on!

This post is from DigiKey Technology Zone

Comments

I am working on it. It is more difficult than I thought. I am confident that I can solve it.  Details Published on 2022-7-15 22:38
 
 
 

409

Posts

7

Resources
3
 
lugl4313820 posted on 2022-7-15 22:27 Through the above, you can see which part of your program has a problem. If the problem is identified, you still need to solve the problem yourself. The host seems to be serious about learning...

I am working on it. It is more difficult than I thought. I am confident that I can solve it.

This post is from DigiKey Technology Zone
 
 
 

2

Posts

0

Resources
4
 

Not bad

This post is from DigiKey Technology Zone
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

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