This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RTOS/MSP-EXP432E401Y:带 MSP432的 HTTP 服务器

Guru**** 2223470 points
Other Parts Discussed in Thread: MSP432E401Y
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/686691/rtos-msp-exp432e401y-http-server-with-msp432

器件型号:MSP-EXP432E401Y
主题中讨论的其他器件:MSP432E401Y

工具/软件:TI-RTOS

我无法对有关 MSP432E401Y 和 HTTP 服务器支持的原始线程进行评论。

但这可能会对某人有所帮助

ti/ndk/nettools/lib/NetTool_IPv4.aem4f 库中已包含 HTTP 服务器支持。

在最新的 SimpleLink MSP432e4 SDK 中、请参阅此文档

/ti/simplelink_msp432e4_sdk_2_10_00_17/docs/ndk/NDK_API_Reference.html #e-web-programming-with the -http-server

解决方案非常简单。

将其添加到 tirtos/ndk_tirtos.c 中的 TCP 示例之一

static void initIHttp (void *hCfg)
{
CI_SERVICE_HTTP http;

bzero (&http、sizeof (http));
http.cisargs.ipaddr = INADDR_ANY;
http.cisargs.pCbSrv=&ServiceReport;
CfgAddEntry (hCfg、CFGTAG 服务、CFGITEM_SERVICE_HTTP、0、
sizeof (http)、(uint8 *)&http、0);
} 

并在 ndkStackThread 中进行更改

/* ip、tcp 和 udp config */
initIp (hCfg);
initTcp (hCfg);
initUdp (hCfg);
initHttp (hCfg); 

此外、如 Tiva 示例中所示添加 Web 文件:

void AddWebFiles (void)
{
//注意:index_size 和 index 都在 index.h 中定义
efs_CreateFile ("index.html"、index_size、(uint8 *) index);
efs_CreateFile ("问候语.html"、问候语_size、(uint8 *)问候语);
efs_CreateFile ("chip.jpg"、chip_size、(uint8 *) chip");
}

void RemoveWebFiles (void)
{
efs_destryfile ("index.html");
efs_destryfile ("类 问候语.html");
efs_destryfile ("chip.jpg");
} 


显然、您必须使用 simplelink_msp432e4_sdk_2_10_00_17\source\ti\ndk\tools\binsrc\中的 binsrc 工具将 Web 文件编译为二进制数组。

我必须将 tirtos/NDK_tirtos.c 中的原始页数从6增加到12、以便有足够的内存来为网页提供服务。

可以静态调用 AddWebFiles/RemoveWebFiles

或像这样配置 xctools

/*========================= 应用程序特定实例========================= //
var Global = xdc.useModule('ti.ndk.config.Global');
var HTTP = xdc.useModule('ti.ndk.config.Http');
Global. ipv6 = false;
var http0Params = new HTTP.Params ();
var http0 = HTTP.create (http0Params);
Global. stackInitHook ="&AddWebFiles";
Global. stackDeleteHook ="&RemoveWebFiles"; 

 在配置 http 服务器之前、我使用了静态选项 tirtos/NDK_tirtos.c。

希望这对他人有所帮助。

如果有人感兴趣、我可以编辑一个具有完全 http 服务器支持的示例、并在 GitHub 上加载

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    1月、
    谢谢您发帖!
    -Bob L.