micropython uart.read() in SAMD51 is incomplete (only 2 bytes returned) #10018
-
I have an ATSAMD51 microcontroller integrated in a project-specific board which has also a xbee3 RF module. This xbee3 module is configured for Transparent Mode and the device type is 'router'. I can check this on the XCTU software. Now, my goal was to install micropython on ATSAMD51 and then send commands to the xbee3 via UART since unfortunately I am not aware of any micropython library that can interact with the xbee. And just out of confusion, I don't want to use the xbee with micropython.
I successfully installed the micropython on the ATSAMD51 and I managed to send commands to the xbee3 via UART. I know this works since when I do Example:
Any command I send I always get only 2 characters + the \r (carriage return). I've tried different baudrates and timeouts and If I try to connect to the xbee directly from the computer via serial this works as expected. So I guess this is somehow related with the micropython UART configuration in the SAMD51? I'm thinking that maybe the fact that the xbee returns a As for the Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Thank you for your report. I do not have an XBEE modem here to replicate the situation, but I can replicate it by simply connecting a second terminal. The problem is caused by the write clearing the Receive interrupt enable bit. I changed the code, but have to test it a little bit. Which board/firmware do you use? Or do you build the firmware yourself?
|
Beta Was this translation helpful? Give feedback.
-
So I made a PR #10021, which fixed that behavior. I do not know how long it takes until that change is in the main line. Until then, you can build your code based on that PR, or I can provide a firmware image for you. |
Beta Was this translation helpful? Give feedback.
-
That's good. Sorry for the confusion. |
Beta Was this translation helpful? Give feedback.
So I made a PR #10021, which fixed that behavior. I do not know how long it takes until that change is in the main line. Until then, you can build your code based on that PR, or I can provide a firmware image for you.