Industruino / IndustruinoSAMD

Industruino SAMD Core
5 stars 4 forks source link

Documentation to use TFTP boot over ethernet #1

Open shanevanj opened 6 years ago

shanevanj commented 6 years ago

The Adrianne documentation quite generic and I am battling to follow how to make to work on the D21G topboard. Is there a better description or examples of how to do this remote boot loading?

Industruino commented 6 years ago

Dear Shane,

Please find instructions below. We will include it into the documentation soon.

Make sure the topboard has the TFTP bootloader enabled (slide switch on the back of the topboard). Setup the address settings of the target controller (has to be done only once) • Install the Industruino FRAM library using the Arduino IDE library manager. Run NetConfigDataMgr sketch to write network parameters to FRAM of Ethernet module (modify parameters and uncomment #write option at top of sketch). Preparation of user sketch: • Make sure to include ResetServer sketch elements in target sketch (otherwise you can’t reset the MCU remotely for future firmware uploads). • Export binary of sketch • Process binary with prepareFile utility (./prepareFile password inputFile outputFile). • Setup TFTP: tftp TargetIPAddress (ex. 192.168.0.200) mode binary trace verbose put outputFile.bin • Reset MCU by loading “http://targetIPaddress:8080/password/reset” ex: "http://192.168.0.200:8080/password/reset” in browser

Best Regards, Loic

On 05 Dec 2017, at 19:11, Shane van Jaarsveldt notifications@github.com wrote:

The Adrianne documentation quite generic and I am battling to follow how to make to work on the D21G topboard. Is there a better description or examples of how to do this remote boot loading?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Industruino/IndustruinoSAMD/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AEE1eLDjVxhcxovI25GBUIups7Ab5z5Wks5s9STDgaJpZM4Q2Ho6.

shanevanj commented 6 years ago

Thanks - this looks solid -

Feedback: FRAM config works perfectly tftp connection works and connects cleanly However, I cannot find the prepareFile utility ?

Process binary with prepareFile utility (./prepareFile password inputFile outputFile).

I also run OSX - is there somewhere I can look for it?

Regards Shane

jcaldeira77 commented 6 years ago

Hi,

Any evolution on this procedure?

I am trying to make it work but until now with no success.

The reset example is working with no problem, but I cannot connect to D21G with tfpt even after program it with NetConfigDataMgr using my network data.

Can you please give me some help?

Thanks.

jcaldeira

Industruino commented 6 years ago

prepareFile.zip

Hi,

Please try with the original instructions above and the attached "prepareFile" file (sorry file was missing originally).

Best Regards, Loic

jcaldeira77 commented 6 years ago

Thanks Loic.

Now it works like a charm.

The missing part is that we have to reset the controller before executing the "put outputFile.bin".

So, in my case, the TFTP procedure works like this:

  1. tftp TargetIPAddress (ex. 192.168.0.200)
  2. mode binary
  3. trace
  4. verbose
  5. Reset MCU by loading “http://targetIPaddress:8080/password/reset
  6. put outputFile.bin

Best Regards, jcaldeira

Danilaska commented 6 years ago

Dear Loic, I am wondering if you can describe in more details this step: Setup TFTP: tftp TargetIPAddress (ex. 192.168.0.200) mode binary trace verbose put outputFile.bin

Currently I have following in command prompt:

C:\Users>TFTP -i 192.168.1.12 PUT outputFile.bin 192.168.1.16 Transfer successful: 44982 bytes in 1 second(s), 44982 bytes/s Where 192.168.1.12 - desktop, and 192.168.1.16 - ethernet module of industruino

And this in Tfptd64 Log:

Connection received from 192.168.1.12 on port 50596 [19/07 18:51:00.569] Write request for file <192.168.1.16>. Mode octet [19/07 18:51:00.569] Using local port 50597 [19/07 18:51:00.569] <192.168.1.16>: rcvd 88 blks, 44982 bytes in 0 s. 0 blk resent [19/07 18:51:00.584]

However nothing appeared on industruino. It seems to be weird.

Thanks for any help!

PS http://192.168.1.16:8080/password/reset” allowed to reset the controller only when I am in the same subnet. When I am trying to do that remotely reset does not work.

lesterlecong commented 5 years ago

Hello Everyone, I have problem in uploading binary in industruino. These are my steps:

  1. I uploaded the NetConfigDataMgr.ino in Industruino.
  2. I created test file: `#include

    include

    include

    include

    include

    include

UC1701 lcd; int row = 0; // Networking parameters for the reset server byte macAddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress locIp(192, 168, 254, 203); IPAddress dnsIp(192, 168, 254, 1); IPAddress gwIp(192, 168, 254, 254); IPAddress netMask(255, 255, 255, 0); int port = 8080; char *reset_path = "password"; EthernetReset reset(port, reset_path);

void setup() { lcd.begin(); reset.begin(macAddr, locIp, dnsIp, gwIp, netMask); }

void loop() { reset.check(); int line = 0; lcd.clear(); lcd.setCursor(row, line); lcd.print("Testing"); delay(200); }`

  1. Export it to binary file.
  2. Process the binary file using prepareFile utility.
  3. Send the binary file to industruino:

TFTP -i 192.168.254.102 PUT EthernetUploadTest.bin 192.168.254.205 Result: Connect request failed.

My operating system is Windows 10. What is my missing step?

Best Regards, Lester

tomtobback commented 5 years ago
  1. Reset MCU by loading “http://targetIPaddress:8080/password/reset” ex: "http://192.168.0.200:8080/password/reset” in browser
lesterlecong commented 5 years ago

Hello Tom, How can i do the reset if the bin file is not yet uploaded to industruino through TFTP?

Best Regards, Lester

tomtobback commented 5 years ago

Your Industruino needs to be running a sketch that has the ResetServer elements already in it, in order for the reset by browser to work. If it is still running the NetConfigDataMgr.ino sketch it cannot pickup the reset request.

MathieuDG2R commented 1 year ago

Good afternoon.

Please, can you tell what software do you use for TFTP??

Thanks

Mathieu