Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project

mbalci
Posts: 3
Joined: Tue May 17, 2016 6:08 pm

Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project

Postby mbalci » Tue May 17, 2016 7:38 pm

Hello ,
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: Select all

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: Select all

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

mbalci
Posts: 3
Joined: Tue May 17, 2016 6:08 pm

Re: Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project

Postby mbalci » Wed May 18, 2016 5:20 pm

Here second problem about uart ;
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);

mbalci
Posts: 3
Joined: Tue May 17, 2016 6:08 pm

Re: Unofficial Development Kit for Espressif ESP32 (Windows) RTOS SDK example Project

Postby mbalci » Fri May 20, 2016 5:42 pm

There is new problem , when i test esp_rtos_sdk_example ;
i get fatal exception at second connect attempt in task2 here is code ;

Code: Select all

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");
        }
    }
}

Who is online

Users browsing this forum: No registered users and 235 guests