Previously to the work discussed in this blog post, U-boot only supported the User datagram protocol (UDP). That limitation meant that downloading ima

HTTP now supported in U-boot

submited by
Style Pass
2023-01-25 20:00:10

Previously to the work discussed in this blog post, U-boot only supported the User datagram protocol (UDP). That limitation meant that downloading images or files from the network could only use protocols that were based on UDP, for example Trivial File Transfer Protocol (TFTP) and Network File System (NFS). After 20 rounds of reviews we have now landed HTTP and TCP support in the U-boot mainline! This means that we can transfer files from an HTTP server. This feature simplifies the development of the embedded systems because HTTP servers are more popular than other servers. Currently it only supports downloading files from an HTTP server on port 80, and there is no support yet for HTTPS.

The first config turns on the TCP stack. The third config enables a simple command wget that can download files from an HTTP server. The second config turns on a TCP option called Selective Acknowledgment (SACK). By default you should turn on all of the three config options. With SACK turned on, we can obtain the maximum performance of the TCP protocol. Nowadays almost all the HTTP servers support SACK by running on the Linux kernel. Even if the server doesn’t support SACK, it is still ok to turn this feature on because there is program logic to detect if the server supports SACK or not.

Please set up a HTTP server first. For example, I install apache2 by “sudo apt install apache2” and then run “sudo a2enmod userdir” to be able to put files in the user directory. Then we put a file to ~/public_html. For example, I put vmlinuz in ~/public_html.

Leave a Comment