2020-07-17 04:09 PM
Nowadays. i debug the uart1 under linux with arm-none-eabi- cross compile.
Now i meet a problem,i config uart with 115200 baudrate and 8 databotlen 1 stopbit none parity.use Hsi for SYSCLK APB1 and APB2 CLK BOTH 36MHz. I can receive data from the chip right from the pc console.but when i send some data to the chip.it's mistake .for examplr i input **a** the chip get the value eq **0xa1** always the data is wrong?
I'm curious how could cause the chip tx right but rx wrong?
Solved! Go to Solution.
2020-07-18 05:04 AM
2020-07-17 04:18 PM
Show code, show wiring, level translators etc.
2020-07-18 02:14 AM
do the following: connect TX of MCU to RX of MCU (disconnect PC=>MCU wire), and send data out. Check the receive buffer = transmit buffer
If different, you have MCU side problem. (SW, HW...)
If same, use DMA to receive multiple bytes without interrupts so it's easier to look at incoming data from PC even if SW is breakpoint.
2020-07-18 05:01 AM
I found the solution after a check the rcc and uart1 relate regs.when i use the hsi clock, i lost calibrate the clock with rcc reg. after i config the reg.it's ok.
2020-07-18 05:01 AM
I found the solution after a check the rcc and uart1 relate regs.when i use the hsi clock, i lost calibrate the clock with rcc reg. after i config the reg.it's ok.
2020-07-18 05:04 AM
the detial link