完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,伙计们,我刚开始尝试Microchip TCP IP堆栈。我目前使用的是TCP IP栈V5.42.08设备族PIC24FJ256+En28IDIDMLAXV4.05.我关心的是程序内存的使用。几周前,我成功地构建了一个运行HTTP Web服务器的示例DeMOAPP,我去了。T程序内存使用率约为36%。但今天,我尝试建立另一个新项目,只是基于成功的一个项目,只修改一些动态变量(只删除HtpPrimtTyLED并添加另一个来切换我的板上的其他设备),我还修改了一个小的HtpExpRuTeGET函数。当我构建这个项目时,我得到了很多这样的链接错误:链接错误:PC相对分支到“MyMeSET”超出了范围。建议大的代码模型。链接错误:PC的相对分支到'StLLEN’超出范围。建议大代码模型。链接错误:PC相对分支到“MyMeSET”超出范围。建议大代码模型。链接错误:PC相对分支到“MEMCMP”超出范围。建议大的代码模型。链接错误:PC相对分支到“STRCMP”超出范围。建议大代码模型…太多了。让我吃惊的是,当我几周前成功地构建它时,我并没有得到这些错误。所以我遵照这个建议,在项目设置中使用大的代码模型,然后构建成功,没有错误,但是问题是现在我消耗了这么多的程序内存大约80%。!!!有没有人能够在不使用大型模型的情况下构建TCP IP协议栈?如果是这样的话,你能给我一些建议吗?还是几乎总是必须使用大模型?请考虑我在TCP IP没有专家,只是新手菜鸟。
以上来自于百度翻译 以下为原文 Hi guys, I'm just started trying Microchip TCP IP Stack. I'm currently using TCP IP Stack v5.42.08 Device family PIC24FJ256 + ENC28. IDE MLABX v4.05. My concern is about the program memory usage. Several weeks ago, I was successfully building one of the example DemoApp that run http web server, and I got program memory usage about 36%. But today, I try to build another new project, just based on the successful one, only modify a few dynamic variables (just deleting HTTPPrint_led and add another one to toggle other device on my board) and I also modified a little HTTPExecuteGet function. When I build the project, I got a lot of link error like these: Link Error: PC Relative branch to '_memset' is out of range. Suggest large-code model. Link Error: PC Relative branch to '_strlen' is out of range. Suggest large-code model. Link Error: PC Relative branch to '_memset' is out of range. Suggest large-code model. Link Error: PC Relative branch to '_memcmp' is out of range. Suggest large-code model. Link Error: PC Relative branch to '_strcmp' is out of range. Suggest large-code model. ... so many of them. To my surprise, I didn't get these error when I successfully build it several weeks ago. So I follow the suggestion and check to use large-code model on project setting, then the build success without error, but the problem is now I consumed so much program memory about 80%!!! Is anyone able to build the TCP IP Stack without using large model? If so then can you give me some tips hows? Or is it almost always must use large model? Please consider me no expert at TCP IP, just newbie rookie. |
|
相关推荐
10个回答
|
|
是否添加了使用浮点变量或计算的任何东西?
以上来自于百度翻译 以下为原文 Did you add anything that uses floating point variables or calculations? |
|
|
|
Qub:不,在“自定义HTTP PAPP.C”中,我只使用LAT来切换一个PIN ON/OFF,只是非常简单的功能。如果我的程序内存使用率是80%,意味着它在我的PIC24FJ256上使用了~~200 KB Flash,这对于构建TCP IP栈来说是正常的吗?(编译器优化0,没有优化,因为我使用免费XC16)
以上来自于百度翻译 以下为原文 @qub: no, in 'CustomHTTPApp.c' I only toggling a pin ON/OFF by using the LAT, just very simple function. If my program memory usage is 80% means it used ~200kB flash on my PIC24FJ256, is that considered normal for building TCP IP Stack? (compiler optimization 0, no optimization since I use free XC16) |
|
|
|
即使是免费的编译器也应该给你一些优化级别。你可以为你的项目中的每个模块(C文件)使用不同的内存模型。你也可以用近和远的属性来限定个人功能,这对Ruben有帮助。
以上来自于百度翻译 以下为原文 Even the free compiler should give you some optimization levels. You can use different memory models for each module (c-file) in your project. You can also qualify individual functions with near and far attributes which could help. /Ruben |
|
|
|
你从哪里得到最初的36%?特别是当网页存储在程序存储器中时,嵌入式HTTP Web服务器可能是巨大的。这就是为什么我质疑这个36%的估计。我怀疑通过改变大的代码模型,程序内存消耗将从36%到80%。
以上来自于百度翻译 以下为原文 Where did you get the initial 36% from? An embedded HTTP Web Server can be big especially when web pages are stored in the program memory. This is why I question this 36% estimate. I doubt by changing to the large code model, the program memory consumption would go from 36% to 80%. |
|
|
|
@ ASCHN0866:在MPLABX项目仪表板上显示成功后,项目成功建立,数据存储器2%,程序内存36%。但现在我想我得到了一些东西,网页确实存储在程序内存中,我觉得在第一次构建我的网页就这么简单和小一,而第二个构建我存储的网页更大,它有两个图像大小700×700 P。这可能是什么原因。无论如何,这可能有点偏离主题,但我看到了几个函数HtpPress在文件“CuutHTPAPP.c”,我想,也许我不需要在我的应用程序,我想我会删除那些联合国。相关功能,我可以吗?它不会使TCP IP栈停止工作吗?
以上来自于百度翻译 以下为原文 @aschen0866: it is shown in MPLABX project dashboard after the project builded successfully, data memory 2%, program memory 36%. But now I think I got something, the web pages are indeed stored in the program memory, I think on the first build my web pages just so simple and small one, while on the second build I stored the web pages which is bigger, it has two images size 700x700p. That maybe what cause it. Anyway, this maybe a bit off topic, but I saw several functions HTTPPrint in file 'CustomHTTPApp.c' that I though maybe I don't need it in my application, I think I'm gonna delete those unrelated functions, is it okay if I do that? it won't make the tcp ip stack stop working right? |
|
|
|
如果它们是空的…我建议你把它们留在那里
以上来自于百度翻译 以下为原文 If they're empty... I'd suggest you leave them in there |
|
|
|
如果没有对网页中的HtpPress功能的任何引用,您可以删除它们。注意,您还需要删除HoppPult.h文件。否则会收到链接错误。HppPult.h将由MPFS2实用程序自动重建。/ Ruben
以上来自于百度翻译 以下为原文 If there isn't any reference to the HTTPPrint functions in the web pages, you can remove them. Note also that you need to remove the HTTPPrint.h file. Otherwise you will get link errors. HTTPPrint.h will automatically be rebuilt by the MPFS2 utility. /Ruben |
|
|
|
实际上,还有一个问题困扰着我……当系统运行时,有时Web页面在我的Web浏览器中显示正确,ExeCuthGET函数也被正确执行,但是通常HTML对象的位置/顺序被拧紧,图像没有被完全加载或者失真的图像是SO。WN代替。有时我需要刷新页面,直到它显示正确的东西。而且有时在运行时,它突然死亡,连接丢失,在我的PC以太网端口的LED停止闪烁,然后我需要重新启动板。我希望它不是由硬件问题引起的(例如电缆质量或我用过的便宜板。有没有建议最小化,所以它不能正常运行?它与TCP缓冲区大小有关吗?如果是这样,在哪一部分的源代码,我可能可以修改,使它运行顺利?
以上来自于百度翻译 以下为原文 Ok, actually there's another issue that bugging me... When the system is running, sometimes the web page shown correct in my web browser, the ExecuteGet function also executed correctly, but often the HTML object position/order is screwed up, the image didn't fully loaded or a distorted image is shown instead. Sometimes I need to refresh the page a lot until it shows the right things. And also sometimes while running, it suddenly die, lost connection, the LED in my PC Ethernet port stop blinking, then I need to restart the board again. I hope it's not caused by the hardware issue (e.g. cable quality or the cheap board that I used). Any suggestion to minimize so it doesn't run eratically? Is it has something to do with TCP buffer size? If so in which part of the source code that I probably could modify to make it run smoother? |
|
|
|
也尝试增加TCP缓冲区的数量。TCP配置头文件在TCPSoCKIDELATIALIDS[]数组中改变。/ Ruben
以上来自于百度翻译 以下为原文 Also try to increase the number of TCP buffers. This is changed in the TCP configuration header file, in the TCPSocketInitializer[] array. /Ruben |
|
|
|
我刚刚做了一些修改:在文件'Hytpp2.h '和'HTTP2.h ''从(4U)到(5U)中改变了“HTTPYTIMEOUT”。在文件'TCPIpH.Enc28·h '中从“(10U)”改为“(20U)”,而我的“TCPSOCKET初始化器”看起来是这样的:TCPoSokCixItAlpalStudio[] = {{TCPYPurPosieGyrimoTCPPclipse,TCPI EthyRAM,12TCPpPurPoSePyPrimePcPyServer、TCPi EythRAM、20, 20 }、TCPPUPosieTyTelNET、TCPI EthyRAM、200, 150 }、/{TCPPUPosieTa TelNET、TCPI EthyRAM、200, 150 }、//TCPPY PoPureSeTelNET、TCPI EthyRAM、200, 150 }、/{TCPPurPosieFTPX命令、TCPI EthyRAM、100, 40 }、/{TCPPU PoPosieFTPX数据、TCPI Ethype 5, 100 },{RAM,0, 128 },{TCPPyPrimeCythyTx,TCPi Ethyram,200, 1 },/{TpPyPurPosieP.TpPyPrimeCyrx,TCPi Ethyram,40, 1500 },{TCPPurPosieUAtAR22TCP桥,TCPI Ethyram,256, 256 },{TCPPurPosieHtpHyServer,TCPI Ethyram,200, 200 },{TCPPurPosieHtpHyServer,TCPI Ethyram,200, 200 },{TCPyPurPoSeLoad、TCPPyEthyRAM、200, 200个t{pPyPosieBikelyyServer、TCPi EthyRAM、25, 20 }、/{TCPPurPosieBurkayyServer、TCPI EthyRAM、25, 20 }、//{TCPPurPosieBikelyyServer、TCPI EthyRAM、25, 20 }、//{TCPPurPosieBurkelyObclipse、TCPI EthyRAM、125, 100 }、};同时更改了{TCPpPurPosieHtpp}。服务器,TCPyEthyRAM,200, 200 }到{TCPPurPosieHhttpHyserver,TCPI EthyRAM,300, 300 }。HTTP网页现在似乎工作得更好。
以上来自于百度翻译 以下为原文 I just made several changes: In file '_HTTP2.h' and 'HTTP2.h' changed 'HTTP_TIMEOUT' from (45u) to (5u). In file 'TCPIP_ENC28.h' changed 'HTTP_DEFAULT_LEN' from (10u) to (20u). and my 'TCPSocketInitializer' looked like this: TCPSocketInitializer[] = { {TCP_PURPOSE_GENERIC_TCP_CLIENT, TCP_ETH_RAM, 125, 100}, {TCP_PURPOSE_GENERIC_TCP_SERVER, TCP_ETH_RAM, 20, 20}, {TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150}, //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150}, //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150}, //{TCP_PURPOSE_FTP_COMMAND, TCP_ETH_RAM, 100, 40}, //{TCP_PURPOSE_FTP_DATA, TCP_ETH_RAM, 0, 128}, {TCP_PURPOSE_TCP_PERFORMANCE_TX, TCP_ETH_RAM, 200, 1}, //{TCP_PURPOSE_TCP_PERFORMANCE_RX, TCP_ETH_RAM, 40, 1500}, {TCP_PURPOSE_UART_2_TCP_BRIDGE, TCP_ETH_RAM, 256, 256}, {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200}, {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200}, {TCP_PURPOSE_DEFAULT, TCP_ETH_RAM, 200, 200}, {TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20}, //{TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20}, //{TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20}, //{TCP_PURPOSE_BERKELEY_CLIENT, TCP_ETH_RAM, 125, 100}, }; Changed both {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200} to {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 300, 300}. The HTTP webpage seems work better now. |
|
|
|
只有小组成员才能发言,加入小组>>
5582 浏览 9 评论
2228 浏览 8 评论
2115 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3399 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2432 浏览 5 评论
1069浏览 1评论
896浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
915浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
947浏览 0评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 威廉希尔官方网站 问题可以咨询我,微信:A-chip-Ti
644浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-7-17 12:06 , Processed in 1.582901 second(s), Total 65, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191