Commit a690c144 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

Make CC3200 example work with XCC3200HZ

PUBLISHED_FROM=42b188c5ae85742681266fee21ec0b0472912743
parent d742b678
...@@ -40,7 +40,9 @@ MONGOOSE_FEATURES = \ ...@@ -40,7 +40,9 @@ MONGOOSE_FEATURES = \
-DMG_MAX_HTTP_SEND_MBUF=1024 \ -DMG_MAX_HTTP_SEND_MBUF=1024 \
-DMG_NO_BSD_SOCKETS -DMG_NO_BSD_SOCKETS
SDK_FLAGS = -DTARGET_IS_CC3200 -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED SDK_FLAGS = -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
# -DTARGET_IS_CC3200 would reduce code size by using functions in ROM
# but then the code won't work on pre-release chips (XCC3200HZ).
CFLAGS += -Os -Wall -Werror \ CFLAGS += -Os -Wall -Werror \
$(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \ $(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
...@@ -92,7 +94,7 @@ CC3200_PLATFORM_SRCS = cc3200_fs.c cc3200_fs_slfs.c cc3200_libc.c cc3200_socket. ...@@ -92,7 +94,7 @@ CC3200_PLATFORM_SRCS = cc3200_fs.c cc3200_fs_slfs.c cc3200_libc.c cc3200_socket.
VPATH += $(COMMON_PATH)/platforms/cc3200 VPATH += $(COMMON_PATH)/platforms/cc3200
FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
DRIVER_SRCS = cpu.c gpio_if.c i2c_if.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c DRIVER_SRCS = cpu.c gpio.c gpio_if.c i2c.c i2c_if.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c cc_pal.c fs.c SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c cc_pal.c fs.c
SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS) SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib \ IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib \
......
...@@ -41,8 +41,10 @@ HEAP_SIZE = 0xB000; ...@@ -41,8 +41,10 @@ HEAP_SIZE = 0xB000;
MEMORY MEMORY
{ {
/* SRAM size of 240KB for cc3200 ES 1.33 device onward */ /* SRAM size of 240KB (0x3C000) for cc3200 ES 1.33 device onward,
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x3C000 * 176KB (0x2C000) for XCC3200HZ (pre-release device).
* We use the latter for maximum compatibility. */
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x2C000
} }
SECTIONS SECTIONS
......
...@@ -91,16 +91,20 @@ static void ev_handler(struct mg_connection *nc, int ev, void *p) { ...@@ -91,16 +91,20 @@ static void ev_handler(struct mg_connection *nc, int ev, void *p) {
switch (ev) { switch (ev) {
case MG_EV_ACCEPT: { case MG_EV_ACCEPT: {
char addr[32]; char addr[32];
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr), mg_conn_addr_to_str(
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT); nc, addr, sizeof(addr),
MG_SOCK_STRINGIFY_REMOTE | MG_SOCK_STRINGIFY_IP |
MG_SOCK_STRINGIFY_PORT);
LOG(LL_INFO, ("%p conn from %s", nc, addr)); LOG(LL_INFO, ("%p conn from %s", nc, addr));
break; break;
} }
case MG_EV_HTTP_REQUEST: { case MG_EV_HTTP_REQUEST: {
char addr[32]; char addr[32];
struct http_message *hm = (struct http_message *) p; struct http_message *hm = (struct http_message *) p;
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr), mg_conn_addr_to_str(
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT); nc, addr, sizeof(addr),
MG_SOCK_STRINGIFY_REMOTE | MG_SOCK_STRINGIFY_IP |
MG_SOCK_STRINGIFY_PORT);
LOG(LL_INFO, LOG(LL_INFO,
("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len, ("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
hm->method.p, (int) hm->uri.len, hm->uri.p)); hm->method.p, (int) hm->uri.len, hm->uri.p));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment