Analysis of Ti cortex m3 serial port to Ethernet routine 1 -- Overview

Source: Internet
Author: User

Ti official website download stellarisware package, decompress by default path, in c: \ stellarisware has multiple folders, where C: \ stellarisware \ board \ rdk-s2e folder is the main character: source code for serial port to Ethernet. It uses lwip1.3.2 as the TCP/IP protocol stack.

TI's serial port to Ethernet module can quickly convert serial transmission to Ethernet transmission. The module includes a microcontroller based on ARM cortex m3, a pair of serial ports and an Ethernet port.

This serial port to Ethernet module software supports the following features:

IP addresses can be allocated statically or dynamically through DHCP;

A Web server used for parameter configuration;

UPnP for device discovery (plug-and-play );

Supports rfc2217-based Telnet clients

Remote firmware upgrade over Ethernet.

Lab hardware:

LSD-S2E21-01 Development Board, processor is lm3s6432.

In the c: \ stellarisware \ board \ rdk-s2e folder, there are two folders, namely boot_eth and ser2enet, boot_eth is the boot loader source code, it is a small part of the entire module code, within 4 K starting with Flash (0x0 ~ 0 xfff), which can be used for loading applications and for "application programming" (IAP) of user programs, that is, remote firmware upgrade, it can be configured through bl_config.h as a remote upgrade communication mode through serial port, IIC, SSI, Ethernet and USB. In the ser2enet folder, the main code for serial port to Ethernet is stored from 0x1000 of flash.

Download the code to hardware: Open the boot loader project in the boot_eth folder, compile and download the code, open the project file in the ser2enet folder, and compile and download the code.

Connect the hardware to the computer through a network cable. If you do not modify the code for converting the serial port to the Ethernet module, it will automatically create an IP address range from autoip. C: 169.254.1.0 ~ 169.254.254.255. The default subnet mask is 255,255, 0, and 0. By default, one of the above IP addresses is selected. Therefore, you must first set the IP address of the computer to the same network segment as the IP address pool above, as shown in 1-1.

Figure 1-1

Open the finder.exe program under the c: \ stellarisware \ tools \ binfolder, click the "refresh" button on the page, and wait a moment to see the IP address of the Development Board, as shown in 1-2.

Figure 1-2

Input the IP address obtained by the finder.exe program in the browser to access the configuration parameter Web server for serial port to Ethernet, as shown in figure 1-3. The software package version I used is 6288.

Figure 1-3

However, not all computer IP addresses are in the 169.254.x.x IP segment. How can we change the program so that the IP address of the Development Board can be the same as the IP address segment of our computer? The benefits of modification are obvious, in this way, only one vswitch can be used to access the Internet and access the Development Board.

First, open the project in the ser2enet folder and locate the static void of autoip. C.
Autoip_create_addr (struct netif * netif, struct ip_addr * ipaddr) function

Ipaddr-> ADDR = htonl (ADDR); changed:

Ipaddr-> ADDR = 0xac101430; // 172.16.20.48 byzhu
Ipaddr-> ADDR = htonl (ipaddr-> ADDR );

Here, I will locate the IP address of my Development Board At 172.16.20.48, because the IP address of my computer also belongs to the same network segment. You can also modify the IP address on the Web server. After the modification, the new IP address can be configured only after the entire flash is completely erased.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.