random uart.write oserror 116
random uart.write oserror 116
Have been getting very few random oserror 116 (timeout?) with uart.write(bytearray(message)) in while loop with delay(200), uart = UART(1, 38400) , after continuous operation 12-24 hours.
message is a 15 byte integer buffer.
There is no uart connection or handshaking involved, so uart.write is just a free run, and generally works OK for about 12 hours of continuous running.
Hardware STM32F407 , firmware stm32f4disc-2016-01-05-v1.5.2-25-g67f40fb.dfu.
I haven't ruled out the hardware, will try another board soon.
Is there any possibility in micropython to look at?
Regards
John
message is a 15 byte integer buffer.
There is no uart connection or handshaking involved, so uart.write is just a free run, and generally works OK for about 12 hours of continuous running.
Hardware STM32F407 , firmware stm32f4disc-2016-01-05-v1.5.2-25-g67f40fb.dfu.
I haven't ruled out the hardware, will try another board soon.
Is there any possibility in micropython to look at?
Regards
John
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: random uart.write oserror 116
I'll try it on a Pyboard and report back tomorrow (I don't have a Discovery board).
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: random uart.write oserror 116
Still going strong 22 hours in. I'll let it run until tomorrow, but I suspect it's specific either to the Discovery or to your actual hardware.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: random uart.write oserror 116
I don't understand how you can get a timeout error on a uart write except if your timeout is shorter than the amount of time it takes for the bits to actually be transmitted,
I suppose if flow control was happening then that could delay things and cause a timeout.
I suppose if flow control was happening then that could delay things and cause a timeout.
Re: random uart.write oserror 116
Apart from from some other processing code and a loop delay(200), I did have 2 lines of printing the same "message" to a PC terminal.I don't understand how you can get a timeout error on a uart write except if your timeout is shorter than the amount of time it takes for the bits to actually be transmitted,
I suppose if flow control was happening then that could delay things and cause a timeout.
Have run same code for just over 24 hours on one of newly arrived pyboards with pybv11-2016-01-06-v1.5.2-25-g67f40fb.dfu firmware.
No issues, will keep testing on both pyboard and discovery.
Have not seen a function yet for a WDT (Watch dog timer) for pyboard STMF405.
Is there a WDT function or should it be implemented by setting appropriate registers for a particular controller?
Regards
John
Re: random uart.write oserror 116
Apology for asking about WDT, should have searched more, newbie impatience syndrome
http://micropython.org/resources/docs/e ... b.WDT.html
Had uart.write oserror 116 generated while I was doing some other stuff on the PC.
Don't know if it has something to do with REPL connection, did not actually directly interact with REPL at the time ?
Regards
John

http://micropython.org/resources/docs/e ... b.WDT.html
Had uart.write oserror 116 generated while I was doing some other stuff on the PC.
Don't know if it has something to do with REPL connection, did not actually directly interact with REPL at the time ?
Regards
John
Re: random uart.write oserror 116
What might be happening is that the USB Mass Storage handler could be causing a flash block to be written. SInce that code runs from an interrupt, it will cause the main thread to suspend. If the time taken to write the flash block is longer than the timeout then that could cause the timeout that you're seeing.
If you use a longer timeout (or no timeout) then the writes will still happen, but there may a gap between the characters where the flash write occurred.
If you use a longer timeout (or no timeout) then the writes will still happen, but there may a gap between the characters where the flash write occurred.
Re: random uart.write oserror 116
Thanks Dave,
You are most likely correct.
I will completely disconnect from PC and run as stand alone with uart.write only, to reflect actual embedded application.
Regards
John
You are most likely correct.
I will completely disconnect from PC and run as stand alone with uart.write only, to reflect actual embedded application.
Regards
John
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: random uart.write oserror 116
My test on the Pyboard ran faultlessly for 44 hours so I shut it down. I hope you solve your problem.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: random uart.write oserror 116
The WDT is implemented for the WiPy but not for the Pyboard as far as I can see. I have some code here https://github.com/peterhinch/micropython-samples.git which enables its use on the Pyboard.EasyRider wrote:Is there a WDT function or should it be implemented by setting appropriate registers for a particular controller?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.