-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIMXRT1050 lpuart bug when changing serial format #15342
Comments
@grumpyengineer thank you for raising this issue.Please take a look at the following comments: Could you add some more detail to the description? A good description should be at least 25 words. NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered. |
cc @ARMmbed/team-nxp |
Thanks for finding this issue and finding a patch for it! I have submitted your change as a PR on the mbed-ce fork: mbed-ce#134 |
@grumpyengineer could you please send a fix via a pull request? |
Pull request #15382 created. I also added the fix to the MIMXRT1170_EVK as it has the same uint8_t temp var to hold a 32 bit register. |
If you are using one of the MIMXRT lpuarts and call set_format to change the serial format the UART can either stop working completely or will transmit but at a very strange baud rate. Example if set to 115200 I was seeing an actual baud of 142900, if anything was transmitted at all.
I was using BufferedSerial in my project.
I did not test UnbufferedSerial as I found the issue in the target's support files.
Target(s) affected by this defect ?
MIMXRT1050_EVK
Toolchain(s) (name and version) displaying this defect ?
ARM Compiler 6.16
What version of Mbed-os are you using (tag or sha) ?
mbed OS 6.15.1
The bug still exists in the github master
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
MBed studio 1.4.4
ARMC 6.16
How is this defect reproduced ?
I was working with lpuart3. The default console is running on lpuart1 with default settings apart from baud rate with no issues.
The bug is in:
mbed-os\targets\TARGET_NXP\TARGET_MCUXpresso_MCUS\TARGET_MIMXRT1050\TARGET_EVK\serial_api.c
All the control registers in the IMXRT1050 are 32bit. base->CTRL has a default value of 0x002c0000.
temp is a uint8_t so when you read in base->CTRL it gets truncated to 0x00.
When it is written back to base->CTRL the lpuart stops working.
Changing temp to a uint32_t resolves the bug
The text was updated successfully, but these errors were encountered: