Skip to content

ports/stm32/boards/NUCLEO_L476RG/mpconfigboard: expose 5 remaining UA…#7058

Closed
aziubin wants to merge 1 commit intomicropython:masterfrom
aziubin:master
Closed

ports/stm32/boards/NUCLEO_L476RG/mpconfigboard: expose 5 remaining UA…#7058
aziubin wants to merge 1 commit intomicropython:masterfrom
aziubin:master

Conversation

@aziubin
Copy link
Copy Markdown
Contributor

@aziubin aziubin commented Mar 21, 2021

STM32L476RG mcu of NUCLEO_L476RG board has 6 UART units in total (USART1, USART2, USART3, UART4, UART5 and LPUART1), but only UART2, which is connected to REPL, has been defined and available for Python code. As a result there is no possibility to use serial communication together with REPL.

This pull request resolves the issue with missing UART units in NUCLEO_L476RG board official MicroPython firmware, which affects others, for example:

Tested on real NUCLEO_L476RG board:

MicroPython v1.14-120-g42cf77f48-dirty on 2021-03-20; NUCLEO-L476RG with STM32L476RG
Type "help()" for more information.
>>> print(pyb.UART(3, 9600).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> print(pyb.UART(1, 9600).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> print(pyb.UART(4, 9600).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> print(pyb.UART(5, 9600).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> print(pyb.UART('LP1',0).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> print(pyb.UART(6, 0).write(b'\xff\x01\x86\x00\x00\x00\x00\x00\x79'))
9
>>> 

Tested in real scenario using MH-Z19C CO2 sensor with UART interface:

MPY: sync filesystems
MPY: soft reboot
78.723  co2         = 500.00
79.735  co2         = 500.00
80.747  co2         = 500.00
81.759  co2         = 500.00
82.77101  co2         = 500.00
83.784  co2         = 500.00
84.796  co2         = 500.00
85.808  co2         = 500.00
86.82  co2         = 500.00
87.832  co2         = 500.00
88.844  co2         = 500.00

References:

Signed-off-by: Alexander Ziubin aziubin@googlemail.com

…RTs.

STM32L476RG mcu of NUCLEO_L476RG board has 6 UART/USART units in total
(USART1, USART2, USART3, UART4, UART5 and LPUART1), but only UART2,
connected to REPL, was defined and available in Python code.
Defined are all 5 remaining units including LPUART1.

Signed-off-by: Alexander Ziubin <aziubin@googlemail.com>
@aziubin aziubin closed this Mar 21, 2021
@aziubin
Copy link
Copy Markdown
Contributor Author

aziubin commented Mar 21, 2021

Commot message does not follow convention.

@davehylands
Copy link
Copy Markdown
Contributor

You can update your commit message by using: git commit --amend and then you don't need to create a new PR

@aziubin
Copy link
Copy Markdown
Contributor Author

aziubin commented Mar 22, 2021

Thank you, @davehylands, I have another issue - Check commit message formatting reports "error: commit 8b98099: Unwanted email address: noreply@github.com", although I have updated my email settings in GitHub and I can see now with git log -1 that my commit message does not contain noreply@github.com.

@davehylands
Copy link
Copy Markdown
Contributor

Sorry - I'm not sure what the issue might be there. Now that your email is setup properly, you might need to create a new branch and cherry pick that commit. I fetched the commit you referenced and it seems to have the correct email.

github.com says "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository."

tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Oct 22, 2022
Use micropython #defines for stream polling operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants