| 没明白,你是怎么配置tsize的 |
| 楼主能发一个官网的TFTP客户端的例子源码吗?邮箱751191958@qq.com,我也在做这一块,看看能否互相交流一下 |
| 帮顶 |
自顶 这么多天过去了 ,一个人都没啊 ![]() |
|
本帖最后由 iDneW 于 2019-8-28 17:30 编辑 已经在网上查了这问题一个多星期了STM32F207做TFTP客户端收不到TFTP服务器的数据问题http://bbs.21ic.com/icview-12469 ... =%E5%A4%B1%E6%A0%BC (出处: 中国电子网技术论坛) 只有这个帖子问题比较相近但没有给解决方法 该问题目前无解,请大家帮忙看看 |
|
现在有了一点思路 通过观察回调函数中 这个判断发现 当前绑定的是69端口,只能接收到RRQ 和 WRQ两种命令 所以无法直接将判断条件修改为TFTP_DATA解决,还有一个问题是根据TFTP协议,服务器接收第一个包用的是69端口,但之后就会新建一个端口用来回消息,那么我如何知道新的端口是多少 如何接收DATA包 switch (op) { case TFTP_RRQ: /* TFTP RRQ (read request) 客户端要求接收TFTP数据,服务器发送数据命令*/ /* Read the name of the file asked by the client to be sent from the SD card */ tftp_extract_filename(FileName, pkt_buf->payload); /* Start the TFTP read mode*/ tftp_process_read(upcb, addr, port, FileName); break; case TFTP_WRQ: /* TFTP WRQ (write request) 客户端发TFTP数据请求,服务器接收数据命令*/ /* Read the name of the file asked by the client to received and writen in the SD card */ tftp_extract_filename(FileName, pkt_buf->payload); //在这个加入擦FALSH /* Initialize FlashDestination variable */ FlashDestination = ApplicationAddress; /* Erase the needed pages where the user application will be loaded */ /* Define the number of page to be erased */ NbrOfPage = FLASH_PagesMask(0x10000);//擦除64K /* Erase the FLASH pages */ for (EraseCounter = 0; (EraseCounter < NbrOfPage) && (FLASHStatus == FLASH_COMPLETE); EraseCounter++) { FLASHStatus = FLASH_ErasePage(FlashDestination + (PageSize * EraseCounter)); } /* Start the TFTP write mode*/ tftp_process_write(upcb, addr, port, FileName); break; default: /* sEndTransfera generic access violation message */ tftp_send_error_message(upcb, addr, port, TFTP_ERR_ACCESS_VIOLATION); /* TFTP unknown request op */ /* no need to use tftp_cleanup_wr because no "tftp_connection_args" struct has been malloc'd */ udp_remove(upcb); break; } |
/1
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2026-4-22 17:23
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网