Backend problem with Nucleo L476RG

255 views
Skip to first unread message

F. B.

unread,
Jan 15, 2023, 10:01:09 AM1/15/23
to thonny
I have a problem on my Mac with MicroPython and the Nucleo Board L476RG. When I connect it this  error message occurs 

PROBLEM IN THONNY'S BACK-END: Internal error (thonny.plugins.micropython.mp_back.ProtocolError: Unexpected read during raw paste).

See Thonny's backend.log for more info.

You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.Process ended with exit code 0.

If I connect the board on Win11 no problems occur !!!

Other Nucleo Board F-401RE works without a problem !!!

Have anybody the same problem or a resolution for this ???

Regards Frank

Wolfgang Ketterer

unread,
Apr 14, 2023, 9:33:06 AM4/14/23
to thonny
I've the same problem. Same board and also a Mac (Intel) 
With mpremote, I get a repl. After all!

Aivar Annamaa

unread,
Apr 15, 2023, 1:02:42 AM4/15/23
to thonny
Which MicroPython version are you using? If you're already at the newest release then it's worth trying the latest daily build.

I've reproduced similar error before, but failed to spot any fault in Thonny's code. The fact that the same boards can be (sometimes) used via other tools, probably indicates that the device goes into a different state (or exposes a MicroPython bug) depending on timing of some previous actions, but it's really hard to pin it down.

If the upgrade doesn't help, then you could try a different submit_mode: https://github.com/thonny/thonny/wiki/MicroPython#advanced-configuration

Best regards,
Aivar

Wolfgang Ketterer

unread,
Apr 17, 2023, 3:52:24 AM4/17/23
to thonny
I had used the latest version 1.19.1 (2022-0618) for the Nucleo L476RG board. Now I have installed the Nightly version 1.19.1.1015 (2323-04-13). But nothing has changed.

I am not sure about the submit_mode. In the Thonny configuration dialog, I can set the interpreter and the port. I assume that the interpreter indicates a corresponding section in the configuration.ini. I don't think the interpreter has anything to do with the problem, but did I set the MicroPython (generic).

So, I added the line submit_mode = paste in the section [GenericMicroPython]. 
The first time I started Thonny, I immediately had a connection (REPL).  But on the second attempt, it did not work again. Instead, I received a new error message.
> PROBLEM IN THONNY'S BACK-END: Internal error (thonny.plugins.micropython.connection.ReadingTimeoutError: Read bytes: bytearray(b'')).

I tried around a bit and sometimes it works, sometimes it doesn't.
But what I have noticed is: When a connection with Thonny was established and I closed Thonny, then I could no longer connect with mpremote.

Now I tried submit_mode = raw:
After this, I can start Thonny, close it and start it again as often as I want. I get a connection immediately every time.

But it is still so that once Thonny has been connected, then it is no longer possible to connect to mpremote. Strange, isn't it?

But first of all I am happy that I get a connection with Thonny at all.

Wolfgang Ketterer

unread,
Apr 17, 2023, 8:39:43 AM4/17/23
to thonny

I would like to add something after playing around with it a bit. The whole thing is quite unstable.
There are statements that verifiably lead to a crash. dir(pyb.Pin) for example.

>>> dir(pyb.Pin) ['__class__', '__name__', 'dict', 'value', '__bases__', '__dict__', 'AF12_SDMMC1', 'AF14_TIM15', 'AF14_TIM16', 'AF14_TIM17', 'AF14_TIM2', 'AF1_TIM1', 'AF1_TIM2', 'AF2_TIM2', 'AF2_TIM3', 'AF2_TIM4', 'AF2_TIM5', 'AF3_TIM8', 'AF4_I2C1', 'AF4_I2C2', 'AF4_I2C3', 'AF5_SPI1', 'AF5_SPI2', 'AF7_USART1', 'AF7_USART2', 'AF7_USART3', 'AF8_LPUART1', 'AF8_UART4', 'AF8_UART5', 'AF9_CAN1', 'AF_OD', 'AF_PP', 'ALT', 'ALT_OPEN_DRAIN', 'ANALOG', 'IN', 'IRQ_FALLING', 'IRQ_RISING', 'OPEN_DRAIN', 'OUT', 'OUT_OD', 'OUT_PP', 'PULL_DOWN', 'PULL_NONE', 'PULL_UP', 'af', 'af_list', 'board', 'cpu', 'debug', 'gpio', 'high', 'init', 'irq', 'low', 'mapper', 'mode', 'name', 'names', 'off', 'on', 'pin', 'port', 'pull'] PROBLEM IN THONNY'S BACK-END: Exception while handling 'execute_source' (thonny.plugins.micropython.mp_back.ProtocolError: Could not read command confirmation). See Thonny's backend.log for more info. You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again. Process ended with exit code 1.

I can't find anything special in the mentioned log files

Wolfgang Ketterer

unread,
Apr 18, 2023, 1:42:21 AM4/18/23
to thonny
I tested it again today on a Windows machine. Thonny has no problems here. The connection is immediately established and also the dir() command does not cause any problems.

Reply all
Reply to author
Forward
0 new messages