2025-02-23 03:33 PM
I use cubemx generate a project with uart5. It's ok.
But when I move some init codes of uart5 to function ``void SystemInit (void)`` tail as below
```
MPU_Config();
HAL_Init();
SystemClock_Config();
PeriphCommonClock_Config();
MX_UART5_Init();
dbg_console_tx5("ABC21", 5);
```
when I debug with cmsis-dap debugger I found the code stuck with
besides the function ``dbg_console_tx5`` is
```
```
is there any tips of this issue ?
2025-02-23 03:45 PM
You move WHAT there exactly?
Perhaps don't move the code there?
SystemInit() is called prior to main(), so the clocks won't be setup optimally,and SysTick won't be working, and thus timeout loops, etc. Things that normally get done in HAL_Init()
2025-02-23 04:11 PM
thanks for your reply,I moved these codes :
MPU_Config();
HAL_Init();
SystemClock_Config();
PeriphCommonClock_Config();
MX_UART5_Init();
dbg_console_tx5("ABC21", 5);
prior to main()