Using printf with \r does not print anything
Posted: Sun Aug 20, 2023 5:02 am
Using M5Stamp ESP32S3 Module. ESP-IDF 5.1
https://shop.m5stack.com/products/m5sta ... 2s3-module
When I printf with \n or \r\n things work fine in the terminal. Yet if I just use \r I get nothing.
In the terminal I get:
Nothing prints out. Yet if I change the printf to: printf("%u : %u\n",a++,b+=2);
it works just fine.
Any ideas why using printf with \r does not work? I have also tried Tera Term and PuTTY. Both have same results as the IDE's built in terminal.
https://shop.m5stack.com/products/m5sta ... 2s3-module
When I printf with \n or \r\n things work fine in the terminal. Yet if I just use \r I get nothing.
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
void app_main(void)
{
u_int16_t a=0;
u_int16_t b=0;
while(1)
{
printf("%u : %u\r",a++,b+=2);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
}
Code: Select all
I (45) boot: ESP-IDF GIT-NOTFOUND 2nd stage bootloader
I (45) boot: compile time Aug 19 2023 23:45:27
I (46) boot: Multicore bootloader
I (49) boot: chip revision: v0.1
I (53) boot.esp32s3: Boot SPI Speed : 80MHz
I (57) boot.esp32s3: SPI Mode : DIO
I (62) boot.esp32s3: SPI Flash Size : 8MB
I (67) boot: Enabling RNG early entropy source...
I (72) boot: Partition Table:
I (76) boot: ## Label Usage Type ST Offset Length
I (83) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (91) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (98) boot: 2 factory factory app 00 00 00010000 00100000
I (106) boot: End of partition table
I (110) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=09ce0h ( 40160) map
I (123) esp_image: segment 1: paddr=00019d08 vaddr=3fc91400 size=027f8h ( 10232) load
I (128) esp_image: segment 2: paddr=0001c508 vaddr=40374000 size=03b10h ( 15120) load
I (138) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=17774h ( 96116) map
I (154) esp_image: segment 4: paddr=0003779c vaddr=40377b10 size=09830h ( 38960) load
I (166) boot: Loaded app from partition at offset 0x10000
I (167) boot: Disabling RNG early entropy source...
I (178) cpu_start: Multicore app
I (178) cpu_start: Pro cpu up.
I (178) cpu_start: Starting app cpu, entry point is 0x40375244
0x40375244: call_start_cpu1 at J:/ESP_5.1/esp/esp-idf/components/esp_system/port/cpu_start.c:154
I (0) cpu_start: App cpu up.
I (196) cpu_start: Pro cpu start user code
I (197) cpu_start: cpu freq: 160000000 Hz
I (197) cpu_start: Application information:
I (200) cpu_start: Project name: test
I (204) cpu_start: App version: 1
I (209) cpu_start: Compile time: Aug 19 2023 23:45:03
I (215) cpu_start: ELF file SHA256: 04421aca5e014a02...
I (221) cpu_start: ESP-IDF: GIT-NOTFOUND
I (226) cpu_start: Min chip rev: v0.0
I (231) cpu_start: Max chip rev: v0.99
I (236) cpu_start: Chip rev: v0.1
I (240) heap_init: Initializing. RAM available for dynamic allocation:
I (248) heap_init: At 3FC94448 len 000552C8 (340 KiB): DRAM
I (254) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (261) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (267) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (274) spi_flash: detected chip: gd
I (277) spi_flash: flash io: dio
I (281) sleep: Configure to isolate all GPIO pins in sleep state
I (288) sleep: Enable automatic switching of GPIO sleep configuration
I (295) app_start: Starting scheduler on CPU0
I (300) app_start: Starting scheduler on CPU1
I (300) main_task: Started on CPU0
I (310) main_task: Calling app_main()
it works just fine.
Code: Select all
...I (310) main_task: Calling app_main()
0 : 2
1 : 4
2 : 6
3 : 8
4 : 10
5 : 12
6 : 14
7 : 16
8 : 18
9 : 20
10 : 22
11 : 24
12 : 26
13 : 28
14 : 30
15 : 32
16 : 34
17 : 36
18 : 38
19 : 40
20 : 42
21 : 44
22 : 46
23 : 48
24 : 50
25 : 52
26 : 54
27 : 56
28 : 58
29 : 60
30 : 62
31 : 64
32 : 66
33 : 68
34 : 70
35 : 72...
Any ideas why using printf with \r does not work? I have also tried Tera Term and PuTTY. Both have same results as the IDE's built in terminal.