wrong data receive with uart1 on stm32f103rct6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-17 4: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.
- Labels:
-
STM32F1 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-18 5:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-17 4:18 PM
Show code, show wiring, level translators etc.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-18 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-18 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-18 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-07-18 5:04 AM
the detial link
