981213 / mtk_uartboot

GNU Affero General Public License v3.0
90 stars 22 forks source link

TX - RX mismatch on mt7988 ? #8

Open Ansuel opened 4 weeks ago

Ansuel commented 4 weeks ago

Hi, in messing with a bananapi r4 and trying to use this tool, I found an interesting interaction between the board and the my serial.

For some reason using the default baudrate values for brom cause a TX -RX mismatch error but using the lowest one makes it work correctly.

Any idea of the cause and how we can bisect this? I notice there were some workaround for some fake serial that required more time...

Problem is that (in theory) my serial is not fake and is even one of the more modern one. It's a CH347. I have verified that the tool works correctly with mt7981 and mt7986.

FIP load is not affected by this problem.

The thing crash at: https://github.com/981213/mtk_uartboot/blob/main/src/bootrom.rs#L47

TX 215 RX 5
981213 commented 6 days ago

Is this issue CH347 specific? Also, have you tried a higher baud rate of 921600 for bootrom? It's possible that the clock setup in bootrom doesn't allow an accurate 460800 baud rate for UART. If that's the case, we could add a list of default baud rates for every SoCs in the utility.