Giter Club home page Giter Club logo

Comments (5)

loathingKernel avatar loathingKernel commented on June 25, 2024

@MarekLew
I am aware of that misuse and to be honest, this was the way it was being done by the previous developer and I didn't want to change it until I knew what I was doing. My guess is that it was being done because of size concerns.

I have a local branch where I have been making changes to create a proper driver infrastructure so different network controllers can be added with ease, and these bugs have been fixed there.

Nevertheless, i am interested in the changes for the W5200 as I do not have it but I would like to add it.

from ariadne-bootloader.

MarekLew avatar MarekLew commented on June 25, 2024

this is "32" package problem. "32" ,"64" package is not analize because packageSize==0

from ariadne-bootloader.

davidhaenggi avatar davidhaenggi commented on June 25, 2024

Hi
I downloaded the Ariadne-Bootloader to use it with a OpenMediaController.
It's based on a Atmega2560 and includes a Wiznet W5100 ethernet chip.
In general the bootloader works great, thanks for the nice work.
While trying to upload bigger firmware files I was running into the "64-Package" Problem.
For me it looks like the arduino is receiving a completely messed up message instead of package number 64. When it tries to read the source IP address of the package it gets some random IP and therefor tries to send a response to this random IP. Thats why the Wiznet chip tries to reach to gateway, because the random IP is not in its IP range.

  • The solution to set the gateway address to the same IP as the TFTP client was not satisfying to me, as I would like to send firmwares from different client-IPs.
  • As a workaround I did some modification to the code:
  1. Don't set return IP address and port if the message is not a valid tftp message. I moved the regarding code to the end of funtion processPacket() and add some validation check.

    - // Set up return IP address and port

    • uint8_t i;
    • for(i = 0; i < 6; i++) spiWriteReg(REG_S3_DIPR0 + i, buffer[i]);

    + // only set return address if paket received is wellformed, to avoid sending to random IP address.

    • if(returnCode != ERROR_INVALID && returnCode != ERROR_UNKNOWN){
    • // Set up return IP address and port
    • uint8_t i;
    • for(i = 0; i < 6; i++) spiWriteReg(REG_S3_DIPR0 + i, buffer[i]);
    • }
  2. And I added the same validation check before sending any response messages in tftpPoll().

    + if(response != ERROR_INVALID && response != ERROR_UNKNOWN)
    sendResponse(response);

Like this the arduino does not send any error for packet 64. The client repeats the packet and the transfer continues. With this changes I was able to set the TFTP_PACKET_DELAY to 0 and have a fast tftp transfer without any failures.
I know this is not a proper solution, but it works for me and I thought it may help someone.

from ariadne-bootloader.

loathingKernel avatar loathingKernel commented on June 25, 2024

Thanks for posting this workaround. It is good to have it here for anyone who is looking for a quick solution on this problem.

from ariadne-bootloader.

loathingKernel avatar loathingKernel commented on June 25, 2024

This issue was moved to loathingKernel#2

from ariadne-bootloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.