[nRF52] seems to be a micropython bug of some kind?

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

[nRF52] seems to be a micropython bug of some kind?

Post by WhiteHare » Thu Oct 25, 2018 3:11 pm

Code: Select all


Radio Buffer =  bytearray(b'Now is the time for all good men to come to the aid                                                       of their party.\x00RXIDLE mode\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x                                                      00\x00\x00\x00\x00')
Radio buffer length =  67
35 Payload received:  Now is the time for all good men to come to the aid of the                                                      ir party.
Memory allocated:   5600
Memory free:   241056
Radio Buffer =  bytearray(b'the quick fox\x00e for all good men to come to the a                                                      id of their party.\x00RXIDLE mode into RX mode to receive another packe\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\                                                      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
Radio buffer length =  13
36 Payload received:  the quick fox
Memory allocated:   5504
Memory free:   241152

I've had trouble reliably receiving long strings, and I think I may have narrowed down to the problem to micropython itself. The first instance above shows the radio buffer after receiving "Now is the time for all good men to come to the aid of their party." It correctly shows that string in the buffer, and it shows some left-over from a previous transmission (as to be expected) after it. Then I send a shorter string, "The quick fox", and the radio buffer shows it as expected, but it also shows even more of a previously transmitted string in the buffer than was there before. This makes no sense, but it does suggest that the problem has something to do with micropython itself.

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: [nRF52] seems to be a micropython bug of some kind?

Post by jickster » Thu Oct 25, 2018 3:51 pm

Is this the most minimal, verifiable and complete example you can create?


Sent from my iPhone using Tapatalk Pro

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: [nRF52] seems to be a micropython bug of some kind?

Post by pythoncoder » Thu Oct 25, 2018 6:35 pm

It is hard to know how to support queries like this. Unless a user has identical hardware and the time to delve into it, the best way forward would be if you could produce a test case which demonstrated the issue on common hardware (ideally Unix, otherwise Pyboard, ESPx). Of course it may be specific to the nRF52 port in which case that will prove impossible.
Peter Hinch
Index to my micropython libraries.

User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

Re: [nRF52] seems to be a micropython bug of some kind?

Post by WhiteHare » Fri Oct 26, 2018 2:25 pm

Understood. I don't think I can do much better at the moment, so for now I'm going to try working around it by sending only shorter strings instead and then stitching them together on the receiving end. Perhaps later the problem will manifest in a way that's easier to reduce to something that can be more readily debugged/fixed.

Post Reply