I attached more detail for the problem.
hc32f4a0 is similar with stm32f407, but the serial irq is different with
stm32f407,
it includes rx and tx and error irq , but stm32f4 includes one irq including rx
and tx.
I uses UART6 as the console device and merge the relative register operation
in hc32 sdk as serial output, the codes as below:
void arm_lowputc(char ch)
{
while(Set != USART_GetStatus(DBG_UNIT, USART_FLAG_TXE));
USART_SendData(DBG_UNIT, ch);
}
Using the function, I can observe the output by UART6. and like _info,syslog
also can print something.
For porting printf, I calls uart_register to register /dev/console with UART6,
but "printf" can't output anything, any log can't appear. and nsh_main also
seems not to be running.
I make a test case in nuttx main under nx_start.
fd = open(/dev/console, "0x6")
write(fd, "test", 4)
it is ok, "test" can print.
but when I use printf, the system is suspend.
By tracing the printf, I think the final operation of printf is operating
/dev/console. so I don't know why
the problem happend.
attached .config and map file. thanks!!!
At 2022-11-24 15:04:00, "wanglingyu" <[email protected]> wrote:
Hi,
I have a problem about nuttx during moving a new chip with hc32.
the board can output with lowputc, system can run, and gpio control is ok,
but printf in libc can't output anything, and at same time, nsh_main also not
running,
it makes shell not being used. the codes is compiled and linked.
Please give some advices for the problem. Thanks!!!
Br,
Wang Lingyu