kity hong wrote: > Hi, everyone, > > here is the configuration of my system: > Linux version 2.4.22-uc0-fs2-rthal5 (un...@linux) > Processor: ARM/VLSI ARM 7 TDMI revision 0 > RT memory manager v1.3 Loaded > RTDM Version 0.5.1 > RTnet 0.7.0 - built on Jan 3 2006 01:20:51 > rtai : 3.6 >
Ugh, that's all very old stuff. Hope you know what you are running... > the flash disk is 4MB, the ram size 16MB. > we download the firmware using RTNET, the firmware size is 1KB. > during the testing,the firmware is downloaded and unzip and run again and > again. RTnet for non-critical firmware download? Is the network occupied with RT traffic at that time, or why this complication? > > After about 20 times or more downloading, the RTNET seem can't work > correctly:the request data from the server gotten in RTNET API was not > updated and delayed to update when next request was coming. > > here is the snapshot of source code: > void cb_recv (struct rtdm_dev_context *context, void *arg) > { > struct msghdr msg; > struct iovec iov; > int ret; > //struct sockaddr_in his_sin; > > iov.iov_base = (void *)buffer; > iov.iov_len = sizeof(buffer); > > msg.msg_name = &dest_addr; > msg.msg_namelen = sizeof(struct sockaddr_in); > msg.msg_iov = &iov; > msg.msg_iovlen = 1; > msg.msg_control=NULL; > msg.msg_controllen=0; > > > /* This demonstrates the fast path to the RTnet API for kernel modules. > Note that this method depends on using the correct RTDM version. An > alternative is to take the file descriptor from a global variable or > pass it in the callback argument "arg" and then call the official API > functions. */ > ret = context->ops->recvmsg_rt(context, 0, &msg, 0); > > if ((ret > 0) && (msg.msg_namelen == sizeof(struct sockaddr_in))) { > > parse_bus_msg ((sbm_t*)buffer, ret); > > } > > } > > the buffer is not updated correctly when error happens. > > what is wrong with RTNET? Have you got an idea ? Start with properly evaluating 'ret' when it's < 0. Beyond that, it's hard to provide any guesses based on the available information. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users