ESP8266 Developer Zone The Official ESP8266 Forum 2016-05-20T17:42:37+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2181 2016-05-20T17:42:37+08:00 2016-05-20T17:42:37+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2181&p=7000#p7000 <![CDATA[Re: Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project]]> i get fatal exception at second connect attempt in task2 here is code ;

Code:

void task2(void *pvParameters)
{
    printf("Hello, welcome to client!\r\n");

    while (1) {
        int recbytes;
        int sin_size;
        int str_len;
        int sta_socket;

        struct sockaddr_in local_ip;
        struct sockaddr_in remote_ip;

        sta_socket = socket(PF_INET, SOCK_STREAM, 0);

        if (-1 == sta_socket) {
            close(sta_socket);
            printf("C > socket fail!\n");
            continue;
        }

        printf("C > socket ok!\n");
        bzero(&remote_ip, sizeof(struct sockaddr_in));
        remote_ip.sin_family = AF_INET;
        remote_ip.sin_addr.s_addr = inet_addr(server_ip);
        remote_ip.sin_port = htons(server_port);

        if (0 != connect(sta_socket, (struct sockaddr *)(&remote_ip), sizeof(struct sockaddr))) {
            close(sta_socket);
            printf("C > connect fail!\n");
            vTaskDelay(4000 / portTICK_RATE_MS);
            continue;
        }

        printf("C > connect ok!\n");
        char *pbuf = (char *)zalloc(1024);
        sprintf(pbuf, "%s\n", "GET / HTTP/1.1\r\nHost: host:port\r\nConnection: close\r\n\r\n");

        if (write(sta_socket, pbuf, strlen(pbuf) + 1) < 0) {
            printf("C > send fail\n");
        }

        printf("C > send success\n");
        free(pbuf);

        char *recv_buf = (char *)zalloc(128);
        while ((recbytes = read(sta_socket , recv_buf, 128)) > 0) {
           recv_buf[recbytes] = 0;
            printf("C > read data success %d!\nC > %s\n", recbytes, recv_buf);
        }
        free(recv_buf);

        if (recbytes <= 0) {
          close(sta_socket);
            printf("C > read data fail!\n");
        }
    }
}

Statistics: Posted by mbalci — Fri May 20, 2016 5:42 pm


]]>
2016-05-18T17:20:14+08:00 2016-05-18T17:20:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2181&p=6959#p6959 <![CDATA[Re: Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project]]> i could not change baud rate of uart in rtos example code ;
i used this function ;uart_init(115200, 115200);
then i get this error ;
undefined reference to `uart_init'
So how can solve this problem?


i solved this problem too ;
copy and paste UART driver "uart.c" files from ESP8266_RTOS_SDK folder to user folder , and .h files do driver folder that crated under esp_rtos_sdk_example_2 folder.

Change row 121 in MAKE file as this ;
MODULES= driver user

Add this one to user_main.c
#include "uart.h"


Then to change baud rate use this function;
UART_SetBaudrate(0,9600);

Statistics: Posted by mbalci — Wed May 18, 2016 5:20 pm


]]>
2016-05-17T19:38:35+08:00 2016-05-17T19:38:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2181&p=6946#p6946 <![CDATA[Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project]]> Could you please put here one example project that can be directly compile with Unofficial Development Kit for Espressif ESP32 (Windows).
I can compile esp_rtos_sdk_example_2 or esp_rtos_sdk_example but both project output is 0x00000.bin and 0x20000.bin.

Console give these messages but

Code:

Free IRam : 6160 or 22544 if 48k IRam
------------------------------------------------------------------------------
Generate 0x00000.bin and 0x40000.bin successully in folder firmware.
0x00000.bin-------->0x00000
0x40000.bin-------->0x40000
Done
firmware folder populated with 0x00000.bin and 0x20000.bin . i use esp12 module . i have already set SPI_SIZE_MAP ?= 4 .
other non rtos firmware are working.



i think , i solve the problem,for rtos sdk they changed base address to 0x20000 so 0x20000.bin seems the correct output ;
You need to change these lines in make file ;

Code:

flash: all
   $(ESPTOOL) -p $(ESPPORT) -b $(BAUD) write_flash $(flashimageoptions) 0x00000 $(FW_BASE)/0x00000.bin 0x20000 $(FW_BASE)/0x20000.bin

Statistics: Posted by mbalci — Tue May 17, 2016 7:38 pm


]]>