Wiznet / RP2040-HAT-MicroPython

54 stars 22 forks source link

Patches try to update files in wrong place. #4

Closed cascmptrski closed 2 years ago

cascmptrski commented 2 years ago

As noted in the clone instructions when applying the patches from the library folder, the instructions show do not work as the ../../ goes a level below where the patches are actually locate if starting from the /library folder. One this is corrected, the folders defined for the patch are still wrong as I get the following error when applying them:

/RP2040-HAT-MicroPython/libraries$ git apply ../patches/0002-Added-AXTLSlibrary.patch
../patches/0002-Added-AXTLSlibrary.patch:101: trailing whitespace.

 * 
../patches/0002-Added-AXTLSlibrary.patch:103: trailing whitespace.
 * 
../patches/0002-Added-AXTLSlibrary.patch:104: trailing whitespace.
 * Redistribution and use in source and binary forms, with or without 
../patches/0002-Added-AXTLSlibrary.patch:107: trailing whitespace.
 * * Redistributions of source code must retain the above copyright notice, 
../patches/0002-Added-AXTLSlibrary.patch:109: trailing whitespace.
 * * Redistributions in binary form must reproduce the above copyright notice, 
error: crypto/aes.c: No such file or directory
error: crypto/crypto_misc.c: No such file or directory
error: ssl/asn1.c: No such file or directory
error: ssl/crypto_misc.h: No such file or directory
error: ssl/os_port.c: No such file or directory
error: ssl/tls1.c: No such file or directory
error: ssl/tls1_svr.c: No such file or directory
error: ssl/x509.c: No such file or directory

The proper files are apparently at a different location as indicated by the error messages when attempting to do the rp2 build for micropython:

/RP2040-HAT-MicroPython/libraries/lib/axtls/ssl/tls1.c: In function 'process_certificate':
/RP2040-HAT-MicroPython/libraries/lib/axtls/ssl/tls1.c:2017:9: error: unused variable 'i' [-Werror=unused-variable]
 2017 |     int i = 0;
      |         ^
/RP2040-HAT-MicroPython/libraries/lib/axtls/ssl/tls1.c:2013:15: error: variable 'chain' set but not used [-Werror=unused-but-set-variable]
 2013 |     X509_CTX *chain = 0;
      |               ^~~~~
cc1: all warnings being treated as errors
make[3]: *** [CMakeFiles/firmware.dir/build.make:2778: CMakeFiles/firmware.dir/RP2040-HAT-MicroPython/libraries/lib/axtls/ssl/tls1.c.obj] Error 1
make[2]: *** [CMakeFiles/Makefile2:1561: CMakeFiles/firmware.dir/all] Error 2
make[1]: *** [Makefile:84: all] Error 2
make: *** [Makefile:21: all] Error 2

As it turns out, the correct starting folder for applying the patch is/library/lib/axtls and the proper update command is git apply ../../../patches/0002-Added-AXTLSlibrary.patch

Once this is done, with the exception of the "trailing whitespace" comments, the files are properly updated and the the rp2 build proceeds to completion. However, the build when loaded to the device fails when running the ping test. No response from the device, though the LED is flashing as desired.

The Ethernet Example Getting Started [Micropython].md file really needs to be updated so that it reflects reality. It provides just enough information to figure out what you might need to do, but all the details are wrong! More examples below:

The Instructions on this startup page are incorrect for both the git and the application of the patches. First the folder should be RP2040-HAT-Micropython and not RP-2040-HAT-C as shown. and second the git command for downloading and building the submodules should be as follows: git clone --recurse-submodules https://github.com/Wiznet/RP2040-HAT-MicroPython.git and not the one shown that does not include the --recurse-submodules

The getting started file at seems to show an alternate method for installing Micropython support. This shows a standard micropython install followed by adding the Wiznet libraries, however, all the library links are broken and clearly refer to a github file structure that either has not yet been build or was changed so that it is no longer in place.

At present the Micropython support for the Wiznet device is not working and the instructions are not current.

irinakim12 commented 2 years ago

Hi~ you need to try to git clone and patch operation. Please use v1.4 or later version.