ensure board_uart_write return -1 on default#3628
Open
Conversation
Signed-off-by: HiFiPhile <admin@hifiphile.com>
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
Updates BSP UART write stubs to return an error (-1) when UART logging isn’t available, preventing the default sys_write() retarget from spinning indefinitely when board_uart_write() previously returned 0 in “no UART” builds.
Changes:
- Change
board_uart_write()stub/default paths fromreturn 0;toreturn -1;across multiple BSP families. - Update PIC32MZ weak
board_uart_write()to return-1instead of falsely reporting success. - Adjust FT9xx
board_uart_write()control flow soreturn count;is inside the#ifdefbranch and the stub branch returns-1.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hw/bsp/xmc4000/family.c | Return -1 when UART is not configured to avoid sys_write() retry loops. |
| hw/bsp/stm32wb/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32u5/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32u0/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32n6/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32l4/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32l0/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32h7rs/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32h7/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32h5/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32g4/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32g0/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f7/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f4/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f3/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f2/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f1/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32f0/family.c | Return -1 in no-UART stub path. |
| hw/bsp/stm32c0/family.c | Return -1 in no-UART stub path. |
| hw/bsp/rp2040/family.c | Return -1 in no-UART stub path. |
| hw/bsp/pic32mz/family.c | Change weak UART write stub to return -1 instead of reporting all bytes written. |
| hw/bsp/mm32/family.c | Return -1 in no-UART stub path. |
| hw/bsp/kinetis_k/family.c | Return -1 in no-UART stub path. |
| hw/bsp/gd32vf103/family.c | Return -1 in no-UART stub path. |
| hw/bsp/ft9xx/family.c | Ensure stub returns -1 and move return count into UART-enabled branch. |
| hw/bsp/ch32v20x/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f45x/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f435_437/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f425/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f423/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f415/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f413/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f403a_407/family.c | Return -1 in no-UART stub path. |
| hw/bsp/at32f402_405/family.c | Return -1 in no-UART stub path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in sizeNo entries. Changes <1% in sizeNo entries. No changes
|
|
| target | .text | .rodata | .data | .bss | total | % diff |
|---|---|---|---|---|---|---|
| stm32f207nucleo/board_test | 5,920 → 5,924 (+4) | — | — | — | 6,456 → 6,460 (+4) | +0.1% |
| stm32f303disco/board_test | 6,124 → 6,128 (+4) | — | — | — | 6,688 → 6,692 (+4) | +0.1% |
| hpm6750evk2/board_test | 14,984 → 14,992 (+8) | — | — | — | 16,304 → 16,312 (+8) | +0.0% |
| stm32h503nucleo/board_test | 9,076 → 9,080 (+4) | — | — | — | 9,928 → 9,932 (+4) | +0.0% |
| msp_exp430f5529lp/board_test | 4,916 → 4,918 (+2) | — | — | — | 5,188 → 5,190 (+2) | +0.0% |
| stm32f303disco/dfu | 14,652 → 14,656 (+4) | — | — | — | 15,800 → 15,804 (+4) | +0.0% |
| stm32f207nucleo/dfu | 15,368 → 15,372 (+4) | — | — | — | 16,536 → 16,540 (+4) | +0.0% |
| stm32h503nucleo/dfu | 16,996 → 17,000 (+4) | — | — | — | 18,432 → 18,436 (+4) | +0.0% |
| at_start_f413/hid_composite_freertos | 20,216 → 20,220 (+4) | — | — | — | 21,300 → 21,304 (+4) | +0.0% |
| at32f403a_weact_blackpill/hid_composite_freertos | 20,224 → 20,228 (+4) | — | — | — | 21,328 → 21,332 (+4) | +0.0% |
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
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.
to fix sys_write blocking if no UART is defined