Hi,
I am a little bit confused, why I have a debug output on my uart[1].
As far as I know, the generic debug output is at uart[0], right?
Is there a way to disable the debug output only at uart[1]?
Thank you in advance!
debug output on uart[1]
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: debug output on uart[1]
Which SDK/software/... are you referring to?
Re: debug output on uart[1]
Oh, sorry!
I'm using the current esp-idf.
I'm using the current esp-idf.
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: debug output on uart[1]
Erm, as far as I'm aware there should be no debug output on UART1, it's not even mapped to GPIOs by default if memory serves. What kinds of messages do you get, and how do you get at the output of that UART?
Re: debug output on uart[1]
Ok, first of all, my uart routine is something like this: (please, don't be confused about my c++ code)
In the attachments is my uart[1] output captured with my oscilloscope.
I hope everything is now clearly discribed, if not, I will try to answer soon!
Code: Select all
UART_InitTypeDef uart_init;
uart_init.num = UART_NUM_1;
uart_init.baud_rate = 57600;
uart_init.data_bits = UART_DATA_8_BITS;
uart_init.parity = UART_PARITY_DISABLE;
uart_init.stop_bits = UART_STOP_BITS_1;
uart_init.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
uart_init.rx_flow_ctrl_thresh = 122;
uart_init.rts_pin = 0;
uart_init.cts_pin = 0;
uart_init.tx_pin = 16;
uart_init.rx_pin = 17;
uart_init.buffer_size = 1024;
UART uart(&uart_init);
FreeRTOS::sleep(1000); // need a delay for initialisation
ModbusMaster modbus(uart);
uint8_t* dat = new uint8_t[6];
modbus.build_query_basis(0x0001, 0x0004, 0x0003, 0x0001, dat);
uint8_t* inBuffer = (uint8_t*) malloc(1024);
for (;;) {
modbus.send(dat, modbus.compute_response_length(dat)); // this is my data protocoll, wich I want to send
while (!uart.available()) { // waiting for uart interrupt
FreeRTOS::sleep(100);
}
int len = uart.getBufferedLength();
inBuffer = uart.read(); // read data (is correct an validated)
printf("DATA>>"); // I can see this on my uart[1]
for (int i = 0; i < len; i++)
printf("%c", inBuffer[i]); // I can see this on my uart[1]
printf("<<\n"); // I can see this on my uart[1]
FreeRTOS::sleep(1000);
}
I hope everything is now clearly discribed, if not, I will try to answer soon!
- Attachments
-
- oszi output.pdf
- output of my oszi
- (43.42 KiB) Downloaded 539 times
Re: debug output on uart[1]
What does UART constructor do?
You see all debug output on UART1 like bootloader, WiFi? Or just your printf?
You see all debug output on UART1 like bootloader, WiFi? Or just your printf?
Re: debug output on uart[1]
Yes, I see the whole debug output on my UART[1].
It starts with "(2264) cpu start: starting.)".. That is, what I can trigger. Unforchenetly, I don't know how to trigger more data in single mode...
Here is my UART init code:
I hope, that you can help me!
It starts with "(2264) cpu start: starting.)".. That is, what I can trigger. Unforchenetly, I don't know how to trigger more data in single mode...
Here is my UART init code:
Code: Select all
UART::UART(const UART_InitTypeDef* uart_conf) {
//this->num = DEFAULT_UART_num;
//this->buffer_size = DEFAULT_UART_buffer_size;
this->num = uart_conf->num;
this->buffer_size = uart_conf->buffer_size;
this->err = ESP_OK;
receiveBuffer = (uint8_t*) malloc(buffer_size);
receiveBuffer_len = 0;
uart_config_t uart_config;
uart_config.baud_rate = uart_conf->baud_rate;
uart_config.data_bits = uart_conf->data_bits;
uart_config.parity = uart_conf->parity;
uart_config.stop_bits = uart_conf->stop_bits;
uart_config.flow_ctrl = uart_conf->flow_ctrl;
uart_config.rx_flow_ctrl_thresh = uart_conf->rx_flow_ctrl_thresh;
if (!UART_driverInstalled[num]) {
sprintf(debugTag, "uart[%d]", (uint8_t) num);
sprintf(_taskName, "%s_eventTask", debugTag);
esp_log_level_set(debugTag, ESP_LOG_INFO);
//Configure UART1 parameters
uart_param_config(num, &uart_config);
//Set UART pins
uart_set_pin(num, uart_conf->tx_pin, uart_conf->rx_pin,
uart_conf->rts_pin, uart_conf->cts_pin);
uart_driver_install(num, buffer_size * 2, buffer_size * 2, 10,
&uart_queue, 0);
//Set uart pattern detect function.
//uart_enable_pattern_det_intr(num, '+', 3, 10000, 10, 10);
//Create a task to handler UART event from ISR
xTaskCreatePinnedToCore(&uart_taskfunwrapper, _taskName, 2048, this, 12,
NULL, 0);
UART_driverInstalled[num] = true;
}
}
Re: debug output on uart[1]
What does your sdkconfig say for https://github.com/espressif/esp-idf/bl ... onfig#L238
Re: debug output on uart[1]
There is everything in standard settings:
CONFIG_CONSOLE_UART_DEFAULT=y
# CONFIG_CONSOLE_UART_CUSTOM is not set
# CONFIG_CONSOLE_UART_NONE is not set
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=115200
CONFIG_CONSOLE_UART_DEFAULT=y
# CONFIG_CONSOLE_UART_CUSTOM is not set
# CONFIG_CONSOLE_UART_NONE is not set
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=115200
Who is online
Users browsing this forum: ESP_Sprite and 212 guests