OS Errors and their meaning

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
cooper
Posts: 23
Joined: Mon Oct 20, 2014 8:40 am

OS Errors and their meaning

Post by cooper » Wed Feb 11, 2015 4:28 pm

Hello,

I'm just wondering if there is a list of OS Error codes and their meanings?

Is this the kind of area where they are described: https://github.com/micropython/micropyt ... e/device.h?

Thank you in advance!

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: OS Errors and their meaning

Post by dhylands » Wed Feb 11, 2015 6:16 pm

OSErrors use errno codes.

On stmhal, the mp_hal_status_to_errno_table provides the mapping from HAL error codes to errno codes.

I don't think that micropython has the errno module, but you can find the CPython version documented here

Unfortunately, the actual numeric values may vary slightly from port to port. Under linux, you can normally find the values described in /usr/include/asm-generic/errno-base.h and errno.h

For stmhal, I have my toolchain installed in ~/stm/gcc-arm-none-eabi-4_8-2014q2/ so the equivalent include files are in ~/stm/gcc-arm-none-eabi-4_8-2014q2/arm-none-eabi/include/sys/errno.h

And if you compare the numeric values between the unix andstmhal versions there is lots of overlap where the numeric values are the same, but there are particular values which differ (and linux has alot more codes defined).

You need to check the toolchain used to build your particular variant to determine the appropriate errno.h file.

cooper
Posts: 23
Joined: Mon Oct 20, 2014 8:40 am

Re: OS Errors and their meaning

Post by cooper » Wed Feb 11, 2015 6:55 pm

Thanks for your detailed reply!

I found this website here: http://www.ioplex.com/~miallen/errcmp.html

I'm using the image that's available on the main website. Which column would be most appropriate?
I'm only really asking because I've seen error 10 and error 116 and have no idea what they mean...

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: OS Errors and their meaning

Post by dhylands » Wed Feb 11, 2015 7:33 pm

I'm not familiar with the toolchain used by the cc3200 port (your initial post referenced a file from that port.

In stmhal, 10 corresponds to ECHILD, and 116 corresponds to ETIMEDOUT.

ECHILD typically only makes sense with some type of multitasking kernel, and I seem to recall hearing that the cc3200 port used an RTOS.

You'd probably need to have somebody more familiar with that particular port reply.

cooper
Posts: 23
Joined: Mon Oct 20, 2014 8:40 am

Re: OS Errors and their meaning

Post by cooper » Wed Feb 11, 2015 8:49 pm

Sorry if I wasn't clear enough, I am using a standard pyboard with version 1.3.8 from here https://micropython.org/download/.
I apologise if I confused you with my incorrect reference, i searched the error code and got that as a result amongst many and looked reasonable to me...

I wouldn't even know where to begin with compiling this for another board/processor!

I've seen those two errors occur the most during my delvings with micropython... Thank you for your input though.
ETIMEDOUT occurs during an I2C read, i imagine that its timing out if its giving this as an error.

Post Reply