Other Parts Discussed in Thread: MSP432E401Y
Tool/software: TI-RTOS
I cannot comment to the original thread regarding the MSP432E401Y and HTTP server support.
But maybe this can help someone
Http server support is already included in the ti/ndk/nettools/lib/nettool_ipv4.aem4f library.
In the latest SimpleLink MSP432e4 SDK see this document
/ti/simplelink_msp432e4_sdk_2_10_00_17/docs/ndk/NDK_API_Reference.html#e-web-programming-with-the-http-server
The solution is very simple.
Add this to the one of the TCP examples in tirtos/ndk_tirtos.c
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_SERVICE, CFGITEM_SERVICE_HTTP, 0,
sizeof(http), (UINT8 *)&http, 0 );
}
And change in ndkStackThread
/* IP, TCP, and UDP config */ initIp(hCfg); initTcp(hCfg); initUdp(hCfg); initHttp(hCfg);
Also add your web files as in the Tiva examples:
Void AddWebFiles(Void)
{
//Note: both INDEX_SIZE and INDEX are defined in index.h
efs_createfile("index.html", INDEX_SIZE, (UINT8 *)INDEX);
efs_createfile("greetings.html", GREETINGS_SIZE, (UINT8 *)GREETINGS);
efs_createfile("chip.jpg", CHIP_SIZE, (UINT8 *)CHIP);
}
Void RemoveWebFiles(Void)
{
efs_destroyfile("index.html");
efs_destroyfile("greetings.html");
efs_destroyfile("chip.jpg");
}
You obviously have to use the binsrc tool found in simplelink_msp432e4_sdk_2_10_00_17\source\ti\ndk\tools\binsrc\ to compile the web files to binary arrays.
I had to increase the raw page count in tirtos/ndk_tirtos.c from 6 to 12 to have enough memory to serve the web pages.
AddWebFiles/RemoveWebFiles can be called statically
or configure xctools like so
/* ================ Application Specific Instances ================ */
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";
I used the static option tirtos/ndk_tirtos.c just before configuring the http server.
Hope it is helpful to someone.
If anyone is interested I can maybe edit one of the example with full http server support and load on github