Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    wiznet 6100 (WZ610MJ Rev1.0) with arduino ethernet libraries

    Spresense
    2
    27
    29347
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AndyAdams last edited by

      Hello,
      I'm trying to establish a connection between my spresense board and the WZ610MJ board using the arduino ethernet libraries but running into a lot of issues. I have been using the edited library linked below but have had limited success. it appears this library doesnt support the 6100, but i'm not entirely sure.

      https://github.com/mhanuel26/Ethernet/commit/ebb4404e1d5559a6ba026536c533c3eb7f89ce15

      K 1 Reply Last reply Reply Quote
      • K
        KamilTomaszewski DeveloperWorld @AndyAdams last edited by

        Hi @andycadams2011

        The official Arduino library does not support wiznet 6100. I found that there is a fork that supports it: https://github.com/Wiznet/Ethernet. Please try this.

        Additionally, you may run into SPI issues on Spresense. Please see how I solved them here: https://github.com/kamtom480/Ethernet/commit/f939d8d83a00223eae38e4d2bc748ec277820064

        Best Regards,
        Kamil Tomaszewski

        A 1 Reply Last reply Reply Quote
        • A
          AndyAdams @KamilTomaszewski last edited by

          @kamiltomaszewski thanks! what is the appropriate way to be loading this library? should i be replacing the ethernet library folder in x86, or should i be loading it into the library folder on documents\arduino\libraries?

          Is this related to the issue i've found where the ethernet libraries default to spi4 on the extension board instead of SPI5 on the main board? I'm currently working with an extension board to work around that issue. Is this a separate issue?

          K 1 Reply Last reply Reply Quote
          • K
            KamilTomaszewski DeveloperWorld @AndyAdams last edited by

            @andycadams2011 The easiest way is to replace the Ethernet library folder in x86.

            Spresense SPI CS is automatically controlled by hardware. Additionally, its behavior is different for different SPI modes. See more here: https://developer.sony.com/develop/spresense/docs/arduino_developer_guide_en.html#_features_and_limitations

            Best Regards,
            Kamil Tomaszewski

            A 1 Reply Last reply Reply Quote
            • A
              AndyAdams @KamilTomaszewski last edited by

              @kamiltomaszewski I'm attempting to load the chatServer example sketch from the arduino IDE and I'm getting an assortment of errors after replacing the x86 ethernet library file with the library you linked. any advice? this is a senior project and im very much in past my understanding at this point.

              e08b0a56-a6d4-4333-9be0-055eed39f67f-image.png

              K 1 Reply Last reply Reply Quote
              • K
                KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                @andycadams2011 You need to make changes from the fork I sent you earlier: https://github.com/kamtom480/Ethernet/blob/f939d8d83a00223eae38e4d2bc748ec277820064/src/EthernetClient.cpp#L50

                A 1 Reply Last reply Reply Quote
                • A
                  AndyAdams @KamilTomaszewski last edited by

                  @kamiltomaszewski Thanks! i went through added the library changes and can now successfully compile. However I'm still having issues communicating with the board. I've taken a capture of the SPI communication between the spresense with extension and the wiz610MJ as well as the console print out showing no ethernet board connected

                  d6180e0f-efe9-4221-8760-0664d27d90dc-image.png

                  K 1 Reply Last reply Reply Quote
                  • K
                    KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                    @andycadams2011 If you are not using a dial, I recommend that you use a pin other than 10 as SPI CS. For example you can use pin 9. To change it, modify: https://github.com/Wiznet/Ethernet/blob/a07596c08dd52038fcf35a6006e05e6f50955477/src/utility/w5100.cpp#L56

                    uint8_t  W5100Class::ss_pin = 9;
                    

                    Then you can use SPI mode 0 for Spresense. If I changed the mode for Spresense to 3, you can change it to 0.

                    #define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
                    

                    You can also try a slower clock.

                    If you want to use SPI on the main board, you can change all SPI. toSPI5. in the library. Thanks to this the library will use SPI on the main board.

                    For example: Change:

                    SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
                    

                    to:

                    SPI5.beginTransaction(SPI_ETHERNET_SETTINGS);
                    
                    A 1 Reply Last reply Reply Quote
                    • A
                      AndyAdams @KamilTomaszewski last edited by

                      @kamiltomaszewski a dial? as in a potentiometer?

                      i'm presently using the extension board in order to get faster SPI speeds from using SPI channel 4 instead of channel 5 on the main board. the ethernet chip im using says it supports up to a 70MHz spi clock speed as well as SPI modes 0 and 3, so i'm not sure if that's the issue. Do you think those options are worth exploring anyway?

                      would using pin 10 as the CS pin cause issues? that is presently how I have it wired on the extension board.

                      Thanks so much for your help
                      Andy Adams

                      A 1 Reply Last reply Reply Quote
                      • A
                        AndyAdams @AndyAdams last edited by

                        @andycadams2011 changing the cs pin helped, it seems there is more meaningful communication going on. What should i expect to be seeing as far as communication between these chips?
                        d5287d77-9c22-4eca-b234-31c00a6670db-image.png

                        K 1 Reply Last reply Reply Quote
                        • K
                          KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                          @andycadams2011 Additionally, if you use a pin other than 10 as SPI CS, the CS control functions should look like this:

                          #elif defined(ARDUINO_spresense_ast)
                          	inline static void initSS() {
                          		pinMode(ss_pin, OUTPUT);
                          	}
                          	inline static void setSS() {
                          		digitalWrite(ss_pin, LOW);
                          	}
                          	inline static void resetSS() {
                          		digitalWrite(ss_pin, HIGH);
                          	}
                          #else
                          

                          Currently, your CS does not change state.

                          A 1 Reply Last reply Reply Quote
                          • A
                            AndyAdams @KamilTomaszewski last edited by

                            @kamiltomaszewski where would i add that code? does that go into one of the library files?

                            also it appears the CS pin is changing, its just being held low through the entire SPI communication
                            dd38e31a-b900-425d-986f-d2012f348d01-image.png

                            1 Reply Last reply Reply Quote
                            • K
                              KamilTomaszewski DeveloperWorld last edited by

                              @andycadams2011 Did you modify this file: https://github.com/Wiznet/Ethernet/blob/a07596c08dd52038fcf35a6006e05e6f50955477/src/utility/w5100.h#L546 as I showed here: https://github.com/kamtom480/Ethernet/commit/f939d8d83a00223eae38e4d2bc748ec277820064?

                              In fact, if you are using a pin other than 10 as SPI CS, you can only modify src/EthernetClient.cpp as I showed here: https://github.com/kamtom480/Ethernet/commit/f939d8d83a00223eae38e4d2bc748ec277820064

                              A 1 Reply Last reply Reply Quote
                              • A
                                AndyAdams @KamilTomaszewski last edited by

                                @kamiltomaszewski yes. i went back and redownloaded the library and made changes mentioned in your first post just to be safe and its still giving me the same issue. Would it be easier if I uploaded my modified library files somewhere?

                                0fde1940-2e65-436d-9704-bfbe82f0e382-image.png

                                K 1 Reply Last reply Reply Quote
                                • K
                                  KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                                  @andycadams2011 Yes, it will be easier when you upload it somewhere.

                                  A 1 Reply Last reply Reply Quote
                                  • A
                                    AndyAdams @KamilTomaszewski last edited by

                                    @kamiltomaszewski https://github.com/Bearham/EthernetLibrary

                                    A 1 Reply Last reply Reply Quote
                                    • A
                                      AndyAdams @AndyAdams last edited by AndyAdams

                                      @andycadams2011 I've narrowed the problem down to the softReset() function call. it appears to return 0 when chip = 61.

                                      9e8323be-ebb1-4dc6-831f-9e8bbe79f063-image.png
                                      console print:
                                      3e7855ad-ef09-42c4-8ece-48493db667b2-image.png

                                      update: I've further narrowed the problem down to this "ReadSYSR_W6100()" function call which evaluated to 255. It would need to be a value between 0-127 in order to break this do-while loop.
                                      675f74f7-ba97-4358-ac7e-94c81a2bcead-image.png

                                      K 1 Reply Last reply Reply Quote
                                      • K
                                        KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                                        @andycadams2011 Please try this: https://github.com/Bearham/EthernetLibrary/pull/1. Remember that SPI CS should be connected to pin 9.

                                        Best Regards,
                                        Kamil Tomaszewski

                                        A 1 Reply Last reply Reply Quote
                                        • A
                                          AndyAdams @KamilTomaszewski last edited by

                                          @kamiltomaszewski That change did not solve the issue, I still get an error that the ethernet shield was not found. I've been calling Ethernet.init(9) in my program, which sets should set "uint8_t W5100Class::ss_pin" variable to 9 if im understanding the library correctly? (which is entirely possible that i'm not)

                                          what else would be useful for me to provide?

                                          K 1 Reply Last reply Reply Quote
                                          • K
                                            KamilTomaszewski DeveloperWorld @AndyAdams last edited by

                                            @andycadams2011 What operating voltage of the GPIO pin sockets are you using: https://developer.sony.com/develop/spresense/docs/hw_docs_en.html#_setting_operating_voltage?

                                            A 1 Reply Last reply Reply Quote
                                            • First post
                                              Last post
                                            Developer World
                                            Copyright © 2021 Sony Group Corporation. All rights reserved.
                                            • Contact us
                                            • Legal