Hi Fabio
The first 4 steps that you have performed seem to be correct.
Step 5 seems strange because when testing TFTP you will need a TFTP server. Firezilla is an FTP (not TFTP) client and so will not be suitable (as far as I know - in any case the TFTP port number is generally 69 and there is no log-in). There are a number of free TFTP servers available on the internet. I don't have on on my PC at the moment but I think that I use something from "Wierd Solutions".
If fnStartTFTP_client(tftp_listener, ucTFTP_server_ip, TFTP_PUT, "test1.txt", '0'); is never called it is of course normal that there will be no Ethereal data collected so I have looked at possible reasons for this:
- fnStartTFTP_client() is called from fnTransferTFTP().
- fnTransferTFTP() is called after successful DHCP
This imples that USE_DHCP must be active in the project, the network parameters must have ACTIVE_DHCP set (DHCP rather than pre-defined IP settings) and it must be able to obtain its IP settings from a DHCL server.
Once the IP settings have been successfully received (usually takes about 8s after power up) then the TFTP transfer should begin.
Now I don't remember exactly why the TFTP test has been combined with the DHCP process; it was obviously a requirement when the demo was built into the project.
If you would like to test TFTF without having to also go through the HDCP process, add the following code to application.c:
if (!iAppState) {
....
....
#ifdef TEST_TFTP
if (!(parameters->ucServers & ACTIVE_DHCP)) { // If we are not using DHCP
fnTransferTFTP(); // start test TFTP transfer
}
#endif
}
The only thing which is not optimum here is that the process will be started before the network link is up on the target (the simulator will immediately try to send). However this should still work because once the destination IP address has been resolved by ARP (will be successful once the link is up) the local TFTP lister will then receive the event TFTP_ARP_RESOLVED. It will then call fnTransferTFTP() again which will then start immediately.
WARNING: If the file '0' is empty, the process will also be terminated without any data being sent. In this case ensure that you have the file "0Menu.html" loaded in FLASH (or simulated FLASH) so that it can transfer something. You are correct that this file will be saved on the TFTP server with the name "test1.txt".
As you have probable already seen, there are two other test cases which can be set:
fnStartTFTP_client(tftp_listener, ucTFTP_server_ip, TFTP_GET, "test.txt", '0'); // get a file (text.txt) from TFTP server and save it locally (to file '0')
or
fnStartTFTP_client(tftp_listener, ucTFTP_server_ip, TFTP_GET_COMPARE, "test.txt", '0'); // get a file (text.txt) from TFTP server and compare it to local file ('0')
The second (TFTP_GET_COMPARE) is rather special because it collects a file from the TFTP server and compares it with the contents of the local file. It doesn't actually save anything locally. This can be useful for a boot loader since it can compare the reference software on the server with a local program (or file). If these match the callback function receives the event TFTP_TRANSFER_READ_COMPLETE.
If these don't match the callback function receives the event TFTP_FILE_NOT_EQUAL: in this case the more standard call using TFTP_GET can be executed to fetch the file but this time save it locally so that the software can be updated.
WARNING: For the compare function to work, SUPPORT_FILE_COMPARE should be activated in config.h.
Note that when debugging on the target (I assume that you are working with the M5223X) you need to ensure that the watchdog has been disabled. It is not possible to step in code with an active watchdog since it will fire and cause such an error message. Make sure that you have the laterst version of the tutorial (get it from the documents page on the uTasker web server) because there is a section addressing this, including how to avoid the problem (basically compile with watchdog disabled, force the watchdog disable after setting a break point at the appropriate location or holding the IRQ4 line to ground at reset - this is used by the demo project code to decide whether to activate the watchdog or not).
The uTasker "Bare-minimum" project doesn't have a simulator project (usually it doesn't need to be simulated because to use it only configuration parameters need changing and it should immediately run on the target).
If you are writing your own boot loader (the "BM"-Bootloader doesn't include TFTP support) then it is possible to copy the demo project and then use its simulator.
Regards
Mark