Search found 74 matches

by nelfata
Fri Jul 04, 2014 3:02 pm
Forum: General Discussion and Questions
Topic: OSError: [Errno 5]
Replies: 28
Views: 11726

OSError: [Errno 5]

I am having some issues reading large files (2MB) in small blocks on the SD card After reading about 200K I get OSError: [Errno 5] Accessing the SD card afterwards is impossible (form Windows), and Ctrl-D in the terminal hangs. Pressing Reset does not recover, 2 resets are needed. I have attached th...
by nelfata
Sun Jun 29, 2014 8:05 am
Forum: Development of MicroPython
Topic: STRING works not with LCD
Replies: 3
Views: 2073

Re: STRING works not with LCD

I have seen this fairly often, but nothing to do with strings (in my code). I think there is some lurking bug somewhere in the firmware (maybe memory leak...) but it is very hard to make repeatable to figure out the problem.
Just FYI.
by nelfata
Wed Jun 25, 2014 8:49 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

The interesting part is that if I remove the try/except block the prints show up as expected.
I will try to make a test module and give you a simple case.
Thank you for the help.
by nelfata
Wed Jun 25, 2014 10:51 am
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

I don't think I am doing anything different than what you have.
I am just using the module differently. I perform the import, instantiate the class and call the member functions.
It is confusing really.
by nelfata
Wed Jun 25, 2014 10:47 am
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

Here are some more definitions: in stmhal/mpconfigport.h ... // NEF: exceptions... extern const struct _mp_obj_type_t mp_type_ReadError; extern const struct _mp_obj_type_t mp_type_NoDataError; #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ { MP_O...
by nelfata
Tue Jun 24, 2014 8:34 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

To add to this note, if there is a print in the C code and a Try/Except is added on the Python side, the print in C seems to be masked. I think we'd need to see an example. The print should be happening right when the print statement is called. I'm not aware of any way to mask the print. The only t...
by nelfata
Tue Jun 24, 2014 8:30 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

Here is an example where the print in C is being masked when using a try/except block in MP: (the Wiki is changing the tabs) MP CODE ----------- while receiveComplete == False: try: d = self.client_s.read(size, flags, timeout_ms*10) except NoDataError: print('no data error in read') continue except:...
by nelfata
Tue Jun 24, 2014 7:20 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

To add to this note, if there is a print in the C code and a Try/Except is added on the Python side, the print in C seems to be masked.
by nelfata
Tue Jun 24, 2014 6:05 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Re: Adding more Exceptions

Thank you for the prompt reply. In fact I was talking about a C exception to be raised from C and caught in MP. I made the modifications in the C firmware, but I was wondering if there is some simpler way to extend the exception (in C) set without modifying the core MP code. By the way since you men...
by nelfata
Tue Jun 24, 2014 8:58 am
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 7646

Adding more Exceptions

What would be the best method to add more exceptions?
- extend the built-in exceptions?
- is there another user extension to add more exceptions

Some examples:
timeout, no data, read error,...

Thanks.