embassy icon indicating copy to clipboard operation
embassy copied to clipboard

Implement support for LPUART

Open FrozenDroid opened this issue 3 years ago • 8 comments
trafficstars

Have tested this with BufferedUart, seems to work well. I have not tested uart v1. Creating this PR now to allow for discussion on whether or not this is the best way to do it.

FrozenDroid avatar Jun 09 '22 13:06 FrozenDroid

Approach LGTM, very nice! :+1:

Have you checked the version of UART and LPUART matches in all chips? ie there's no chip with LPUARTv1 and UARTv2. This would be a crime from ST's part, but they like committing crimes, so it's worth checking...

Dirbaio avatar Jun 09 '22 13:06 Dirbaio

Have you checked the version of UART and LPUART matches in all chips?

I haven't, how would I go about searching through all the files to check this?

FrozenDroid avatar Jun 17 '22 11:06 FrozenDroid

manually :smiling_face_with_tear: ... Checking one chip per family should be safe enough.

Dirbaio avatar Jun 17 '22 18:06 Dirbaio

Ah dear, already found an example of a chip (STM32L4A6) that has a v1 LPUART but a v2 USART... 🙃

Where do we go from here?

FrozenDroid avatar Jun 28 '22 10:06 FrozenDroid

Main difference between a v1 and v2 LPUART seems to be:

  • support for (TX & RX) FIFO
  • prescaler

Seems to me that a mixed version case should be fine. The chip previously mentioned compiles fine. @Dirbaio thoughts?

FrozenDroid avatar Jun 28 '22 11:06 FrozenDroid

@FrozenDroid if it builds and works then LGTM! :)

could you rustfmt so the CI passes?

Dirbaio avatar Jul 08 '22 15:07 Dirbaio

I've been asked to take over here, but I'm not sure how to properly resolve the conflicts. Apparently this is a PR from our master branch, which also seems to have other work on it. Should I open a new PR from a dedicated branch, with just the LPUART commits, rebased on current upstream master?

darkwater avatar Jul 12 '22 10:07 darkwater

yes! there should be no unrelated commits. If you have to open a new PR then so be it :)

Dirbaio avatar Jul 12 '22 14:07 Dirbaio