Search found 12 matches

by BiHan90
Fri Apr 30, 2021 9:36 pm
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

Thanks a lot @WiFive.. it works now :)
by BiHan90
Thu Apr 29, 2021 3:10 pm
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

Ok so I partially fixed the issue and now I can read the letter "p" that is being transmitting from a pic microcontroller. but I'm having this Guru meditation error after the buffer get full. I tried to flush after the loop but it didn't help. The code is below : #include "freertos/FreeRTOS.h" #incl...
by BiHan90
Mon Apr 26, 2021 8:39 am
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

At the beginning, I was using only the second one (the one terminated with 0) but then I added the first one (before the while loop) just to compare.
by BiHan90
Sun Apr 25, 2021 9:46 am
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

I have already specified them earlier but then I changed them into default hoping it could help!
by BiHan90
Sat Apr 24, 2021 10:02 pm
Forum: General Discussion
Topic: Link a library with ESP-IDF export.bat
Replies: 0
Views: 1525

Link a library with ESP-IDF export.bat

Hello Guys, I'm trying to use ESP32 to publish topics within Mosquitto via CLion IDE (Windows 10), I'm trying to link the library (Mosquitto.lib) with ESP-IDF tools so that it helps the compiler to read it. To do that, I added this path to environment variables : C:\Program Files\mosquitto\devel The...
by BiHan90
Sat Apr 24, 2021 9:40 pm
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

#include <stdio.h> #include <esp_vfs_fat.h> #include <esp_modbus_slave.h> #include <esp_err.h> #include "UART.h" void app_main() { int uart_buffer_size = (1024*2); const int uart_num = UART_NUM_2; uart_config_t uart_config = { .baud_rate = 115200, .data_bits = UART_DATA_8_BITS, .parity = UART_PARIT...
by BiHan90
Wed Apr 07, 2021 6:49 pm
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

@ESP_Sprite.. So i did add '\0' at the end of the string but nothing changed, the serial monitor is always rubbish. what's weird to me is that i can see a response on the oscilloscope when i do an echo, so that means my esp32 is receiving correctly via rx buffer and write the data back via tx buffer.
by BiHan90
Tue Apr 06, 2021 7:21 am
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

#define _XTAL_FREQ 16000000 /* * Includes */ #include <xc.h> #include <stdint.h> #include<stdlib.h> /* * Prototypes */ void initChip(void); /* * Global Variables */ /* * Functions */ void initChip(void) { //CLK settings OSCTUNE = 0x80; //3X PLL ratio mode selected OSCCON = 0x70; //Switch to 16MHz H...
by BiHan90
Mon Apr 05, 2021 10:13 am
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

@ESP_Sprite.. So, i let the pic transmits a letter (uint8_t) instead of an integer and the final code is as below: void app_main() { int len; int uart_buffer_size = (1024*2); const int uart_num = UART_NUM_2; uint8_t data[128]; uart_config_t uart_config = { .baud_rate = 9600, .data_bits = UART_DATA_8...
by BiHan90
Sun Apr 04, 2021 9:42 am
Forum: General Discussion
Topic: ESP32/UART : Buffer is null
Replies: 22
Views: 19318

Re: ESP32/UART : Buffer is null

Hi @ESP_Sprite,

It's the same code, i just replaced : (Int data = 0) By (int *data = (int *) malloc(uart_buffer_size);)