File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -767,12 +767,14 @@ int log_printfv(const char *format, va_list arg)
767
767
return 0 ;
768
768
}
769
769
}
770
+ /*
771
+ // This causes dead locks with logging in specific cases and also with C++ constructors that may send logs
770
772
#if !CONFIG_DISABLE_HAL_LOCKS
771
773
if(s_uart_debug_nr != -1 && _uart_bus_array[s_uart_debug_nr].lock){
772
774
xSemaphoreTake(_uart_bus_array[s_uart_debug_nr].lock, portMAX_DELAY);
773
775
}
774
776
#endif
775
-
777
+ */
776
778
#if CONFIG_IDF_TARGET_ESP32C3
777
779
vsnprintf (temp , len + 1 , format , arg );
778
780
ets_printf ("%s" , temp );
@@ -782,15 +784,19 @@ int log_printfv(const char *format, va_list arg)
782
784
ets_write_char_uart (temp [i ]);
783
785
}
784
786
#endif
785
-
787
+ /*
788
+ // This causes dead locks with logging and also with constructors that may send logs
786
789
#if !CONFIG_DISABLE_HAL_LOCKS
787
790
if(s_uart_debug_nr != -1 && _uart_bus_array[s_uart_debug_nr].lock){
788
791
xSemaphoreGive(_uart_bus_array[s_uart_debug_nr].lock);
789
792
}
790
793
#endif
794
+ */
791
795
if (len >= sizeof (loc_buf )){
792
796
free (temp );
793
797
}
798
+ // flushes TX - make sure that the log message is completely sent.
799
+ if (s_uart_debug_nr != -1 ) while (!uart_ll_is_tx_idle (UART_LL_GET_HW (s_uart_debug_nr )));
794
800
return len ;
795
801
}
796
802
You can’t perform that action at this time.
0 commit comments