Skip to content

Commit 456c3b4

Browse files
authored
Merge pull request #606 from bigbrett/tc3-uart-quickfix
TC3: UART quickfix
2 parents f7d5260 + 4761410 commit 456c3b4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

hal/aurix_tc3xx.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ int hal_hsm_server_cleanup(void);
136136
/* Force longcall on printf functions (called from panic) */
137137
void uart_printf(const char* fmt, ...) TC3_LONGCALL;
138138
void uart_vprintf(const char* fmt, va_list argp) TC3_LONGCALL;
139+
void wolfBoot_panic(void) TC3_LONGCALL;
139140
#endif
140141

141142
/* RAM buffer to hold the contents of an entire flash sector*/
@@ -300,14 +301,12 @@ void hal_init(void)
300301

301302
#ifdef DEBUG_UART
302303
uart_init();
303-
304304
#ifndef WOLFBOOT_AURIX_TC3XX_HSM
305-
char hello_string[] = "Hello from TC3xx wolfBoot on Tricore\n";
305+
wolfBoot_printf("Hello from TC3xx wolfBoot on Tricore\n");
306306
#else
307-
char hello_string[] = "Hello from TC3xx wolfBoot on HSM\n";
308-
#endif
309-
uart_write(hello_string, sizeof(hello_string) - 1);
307+
wolfBoot_printf("Hello from TC3xx wolfBoot on HSM\n");
310308
#endif
309+
#endif /* DEBUG_UART */
311310
}
312311

313312
/* This function is called by the bootloader at a very late stage, before
@@ -322,6 +321,10 @@ void hal_prepare_boot(void)
322321
#endif /* WOLFBOOT_AURIX_GPIO_TIMING */
323322

324323
#ifdef DEBUG_UART
324+
/* One final printf so we can block on transmit completion. Prevents reset
325+
* before last byte is transmitted */
326+
wolfBoot_printf("hal_prepare_boot\n");
327+
tc3_uart_BlockOnTC(board_uart);
325328
tc3_uart_Cleanup(board_uart);
326329
#endif
327330

0 commit comments

Comments
 (0)