-
-
Notifications
You must be signed in to change notification settings - Fork 80
pbdrv/uart: Debug printf bugfixes, va_list version. #407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's useful to have a vprintf version of the uart_debug functions. This will be used in a later change to assist with logging messages originating in BTStack. Also, there was a bug where the error from writing to the UART was not captured. This fixes that bug and logs the error on the next attempt to use the port. We also increase the buffer size because when doing higher volume logging the 256 bytes alloted before were sometimes not enough.
Member
|
Merged, thanks! Tested that debug print is still working on Prime Hub. diff --git a/lib/pbio/platform/prime_hub/pbdrvconfig.h b/lib/pbio/platform/prime_hub/pbdrvconfig.h
index 66b3816b2..43b5883a1 100644
--- a/lib/pbio/platform/prime_hub/pbdrvconfig.h
+++ b/lib/pbio/platform/prime_hub/pbdrvconfig.h
@@ -109,7 +109,7 @@
#define PBDRV_CONFIG_SOUND_STM32_HAL_DAC (1)
#define PBDRV_CONFIG_UART (1)
-#define PBDRV_CONFIG_UART_DEBUG_FIRST_PORT (0)
+#define PBDRV_CONFIG_UART_DEBUG_FIRST_PORT (1)
#define PBDRV_CONFIG_UART_STM32F4_LL_IRQ (1)
#define PBDRV_CONFIG_UART_STM32F4_LL_IRQ_NUM_UART (6)
diff --git a/lib/pbio/sys/hmi_pup.c b/lib/pbio/sys/hmi_pup.c
index 047a97891..4b9a224c2 100644
--- a/lib/pbio/sys/hmi_pup.c
+++ b/lib/pbio/sys/hmi_pup.c
@@ -28,7 +28,7 @@
#include "hmi.h"
-#define DEBUG 0
+#define DEBUG 1
#if DEBUG
#include <pbdrv/../../drv/uart/uart_debug_first_port.h> |
dlech
reviewed
Nov 3, 2025
| void pbdrv_uart_debug_printf(const char *format, ...) { | ||
|
|
||
| void pbdrv_uart_debug_vprintf(const char *format, va_list args) { | ||
| char buf[BUF_SIZE]; |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is making the stack quite huge now. We should probably use a separate size for this buffer and the ring buffer.
Contributor
Author
|
I don’t object! I will probably have no cycles to further adjust this until
the week of the 17th.
…On Mon, Nov 3, 2025 at 7:24 AM David Lechner ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/pbio/drv/uart/uart_debug_first_port.c
<#407 (comment)>
:
> */
-void pbdrv_uart_debug_printf(const char *format, ...) {
-
+void pbdrv_uart_debug_vprintf(const char *format, va_list args) {
char buf[BUF_SIZE];
This is making the stack quite huge now. We should probably use a separate
size for this buffer and the ring buffer.
—
Reply to this email directly, view it on GitHub
<#407 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGDGTCMGSUQEYZ4XJKZ7NT325JO7AVCNFSM6AAAAACKTYUODCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTIMJRGI3TINJQHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's useful to have a vprintf version of
the uart_debug functions. This will be used
in a later change to assist with logging
messages originating in BTStack.
Also, there was a bug where the error from
writing to the UART was not captured. This
fixes that bug and logs the error on
the next attempt to use the port.
We also increase the buffer size because when
doing higher volume logging the 256 bytes alloted
before were sometimes not enough.