Statement of originality:

This original tutorial was created by ALINX Electronic Technology (Shanghai) Co., Ltd. (ALINX), and the copyright belongs to the company. If you want to reprint, you need to authorize and indicate the source.

Applicable board models:

AXU2CGA/AXU2CGB/AXU3EG/AXU4EV-E/AXU4EV-P/AXU5EV-E/AXU5EV-P /AXU9EG/AXU15EG

The vivado project directory is “ps_hello/vivado”

The vitis project directory is “ps_remote/vitis”

In actual work, you will encounter product upgrade problems. If you follow the program burning method, you may need to open the product shell, which is undoubtedly. This chapter introduces a method for remotely updating FLASH programs through the network, including UDP and TCP methods.

Software Engineer Job Content

The following is the responsibility of software engineers.

1. Vitis program development

1.1 UDP transmission method

1) The LWIP part mainly deals with the reception of BIN files, the program is lwip_app.c

2) After creating the project, you need to enable the lwip library and set it up, enable the DHCP function, set the pbuf space as large as possible, increase the cache space, and improve efficiency.

3) The udp_receive function is the receiving callback function set up. Its main function is to receive data and cache the received data into the FlashRxBuffer space for use in updating the Flash. After sending the data, send the “update” command to start updating the flash. This command is judged in the function.

4) In the while loop statement, judge the value of the StartUpdate variable and update the Flash.

1.2 TCP transmission mode

1) The LWIP part of TCP is also the lwip_app.c file, and the control part refers to the lwip echo server routine to create a TCP Server

2) Similar to UDP, in the recv_callback receiving callback function, the received BIN file is cached, the start update command is also update, and other parts are similar to UDP.

1.3 QSPI Flash read and write control

Both UDP and TCP use the same QSPI read and write files qspi.c and qspi.h

1) The qspi.c file is modified according to xqspipsu_generic_flash_polled_example

2) There are mainly the following functions, write enable and disable, flash erase, flash write, flash read, read Flash ID, etc.

3) The main function is update_qspi, where TotalLen is the total number of bytes to be updated, and FlashDataToSend is the buffer area for storing updated data. The size of TotalLen is used for Sector erasing, so the erased space will be slightly larger than TotalLen; then write to Flash, use the FlashWrite function to write; finally, verify, read data from Flash, and compare with the written data Compared.

2. On-Board Verification

We can choose the BOOT.bin file of other routines. We set up the experiment under the ideal state of the network environment. When doing this experiment, do not open other upper computer software related to Ethernet transmission, because the port number is the same, which may cause conflicts.

1) First connect the development board and connect the network cable to the network port

2) If there is a DHCP server, the IP will be automatically assigned to the development board; if there is no DHCP server, the default IP address of the development board is 192.168.1.10, and the IP address of the PC needs to be set to the same network segment, as shown in the figure below. At the same time, make sure that there is no IP address of 192.168.1.10 in the network, otherwise it will cause IP conflicts, resulting in failure to display. You can enter ping 192.168.1.10 in CMD before the board is powered on to check whether the ping is successful. If the ping is successful, it means that the IP address exists in the network and cannot be verified.

After there is no problem, open the serial port software.

2.1 UDP method

1) Download the program, you can see the information in the serial port

2) Open the board network upgrade software in the project directory

3) Fill in the IP address and port number of the board, select the UDP sending method, select the BOOT.bin file, and click send

4) After sending, the number of bytes sent will be displayed

5) In the serial port window, you can see the number of bytes received by the board, as well as the process of erasing, programming, and verifying.

6) Turn off the power and turn on the DIP switch to select the QSPI startup mode, turn on the power to start, and you can see the program running.

2.2 TCP mode

1) Download the program, you can see the serial port information

2) Open the board network upgrade software in the project directory

3) Fill in the IP address and port number, select the TCP sending method, select the BOOT.bin file, and click send

4) Like UDP, you can also see the number of bytes sent

5) In the serial port window, you can see the number of bytes received by the board, as well as the process of erasing, programming, and verifying.

6) After power off, select the QSPI startup mode through the DIP switch, turn on the power to start, and you can see the program running.

Leave a Reply

Your email address will not be published.