Skip to content

kinetis: Use 9 bit UART config for 8E1, 8O1 modes#7165

Merged
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
mfrey:kinetis-uart
Jun 13, 2017
Merged

kinetis: Use 9 bit UART config for 8E1, 8O1 modes#7165
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
mfrey:kinetis-uart

Conversation

@mfrey
Copy link
Copy Markdown
Contributor

@mfrey mfrey commented Jun 9, 2017

Pull request GH-7098 introduced the "8 data bits, even parity, 1 stop bit" mode to the Kinetis UART configuration. Unfortunately, the configuration misses the correct configuration since the current setting reduces the number of actual data bits to 7. Hence, the 9 bit mode needs to be enabled (so it becomes 8 data bits + 1 parity bit).

The following snippet is from the MKW2xD Reference Manual and specifies the required changes.
image

@cgundogan cgundogan added the Platform: ARM Platform: This PR/issue effects ARM-based platforms label Jun 9, 2017
.dev = UART0,
.clken = (volatile uint32_t*)(BITBAND_REGADDR(SIM->SCGC4, SIM_SCGC4_UART0_SHIFT)),
.freq = CLOCK_CORECLOCK,
.pin_rx = GPIO_PIN(PORT_D, 6),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have this board so I can't test this, could you open a separate PR for this, please?

@jnohlgard
Copy link
Copy Markdown
Member

The configuration change looks correct, but I did not test on actual hardware yet.

Copy link
Copy Markdown
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message is a bit too long and should start with "kinetis:"

suggestion:
kinetis: Use 9 bit UART configuration for 8E1, 8O1 modes

@mfrey
Copy link
Copy Markdown
Contributor Author

mfrey commented Jun 11, 2017

The commit message is a bit too long and should start with "kinetis:"

Shortened commit message and also removed the changes to the pba-d-01-kw2x uart configuration and will make a separate PR.

EDIT: updated the PR in order to reflect that the pba-d-01-kw2x uart changes are not part of the PR anymore

@miri64 miri64 changed the title enable 9-bit configuration in Kinetis UART configuration for 8E1 and 8O1 modes kinetis: Use 9 bit UART config for 8E1, 8O1 modes Jun 11, 2017
@PeterKietzmann
Copy link
Copy Markdown
Member

Works as expected.

  1. Without this PR
    UART_MODE_8E1

uart_mode_8e1_wo

UART_MODE_8O1

uart_mode_8o1_wo

  1. With this PR
    UART_MODE_8E1

uart_mode_8e1_w

UART_MODE_8O1

uart_mode_8o1_w

(Of course I adapted the logic analyzer according to the used setting)

@PeterKietzmann PeterKietzmann added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 12, 2017
Copy link
Copy Markdown
Contributor

@haukepetersen haukepetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like I did something wrong when testing my initial PR... ACK and thanks for the fix!

@PeterKietzmann
Copy link
Copy Markdown
Member

@gebart would you approve now?

@jnohlgard jnohlgard merged commit 54b6884 into RIOT-OS:master Jun 13, 2017
@mfrey mfrey deleted the kinetis-uart branch June 13, 2017 09:27
@aabadie aabadie modified the milestone: Release 2017.07 Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants