Search found 3455 matches

by dhylands
Sat May 17, 2014 1:31 pm
Forum: General Discussion and Questions
Topic: What is raw REPL
Replies: 5
Views: 6159

Re: What is raw REPL

Raw REPL allows python code to be entered and executed on the board from a script.

The pyboard.py script uses this to download code and run it.

Right now this is primarily used as part of the test suite for running tests on the board, but it could be useful for development as well.
by dhylands
Fri May 16, 2014 7:35 pm
Forum: General Discussion and Questions
Topic: importing own module
Replies: 5
Views: 6253

Re: importing own module

So I was able to do imports in one of 2 ways: 1 - I created mod1.py in the root called mod1.py: def mod1(): print('mod1') 2 - I created an __init__.py in a directory called mod2: def mod2(): print('mod2') >>> import mod1 >>> mod1.mod1() mod1 >>> import mod2 >>> mod2.mod2() mod2 So from my host, the ...
by dhylands
Fri May 16, 2014 4:01 pm
Forum: General Discussion and Questions
Topic: REPL docs?
Replies: 3
Views: 2271

Re: REPL docs?

I corrected the spelling in the title. REPL, for the uninitiated means Read-Eval-Print-Loop. Python has several introspection capabilities . You can use the dir command to examine objects. For example, suppose you'd like to know which modules are implemented in pyb. >>> import pyb >>> dir(pyb) ['__n...
by dhylands
Fri May 16, 2014 2:36 pm
Forum: General Discussion and Questions
Topic: Help getting REPL prompt in screen
Replies: 6
Views: 3881

Re: Help getting REPL prompt in screen

I thought that the serial line was created before the script runs, and that handling the characters was all interrupt based.
by dhylands
Fri May 16, 2014 2:13 pm
Forum: General Discussion and Questions
Topic: Help getting REPL prompt in screen
Replies: 6
Views: 3881

Re: Help getting REPL prompt in screen

You should also be able to use Control-C to stop the running program and be dropped to the REPL prompt.
by dhylands
Thu May 15, 2014 4:48 pm
Forum: General Discussion and Questions
Topic: [Solved] Use of class Pin crash the pyboard
Replies: 8
Views: 4663

Re: [Solved] Use of class Pin crash the pyboard

I'm also using the latest dfu-util, built from source. I just thought I'd mention that in case you run into any differences.

The latest dfu-util supports -s:leave properly when flashing, which is why I'm using it (just an FYI)
by dhylands
Thu May 15, 2014 4:19 pm
Forum: General Discussion and Questions
Topic: [Solved] Use of class Pin crash the pyboard
Replies: 8
Views: 4663

Re: [Solved] Use of class Pin crash the pyboard

So the 16K winds up being what dfu-util uploads by default. So the firmware is laid out as 16K vectors + 112K MSD area + firmware. I did: 336 >dfu-util -a 0 --upload firmware.bin -s:524288 dfu-util 0.7 Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2012 Tormod Vold...
by dhylands
Thu May 15, 2014 3:45 pm
Forum: Development of MicroPython
Topic: Communication between micro pyhton and c++
Replies: 4
Views: 3012

Re: Communication between micro pyhton and c++

I'll guess that you need to send \r as the end of line rather than \n

Most serial terminals send \r when you hit ENTER.
by dhylands
Thu May 15, 2014 3:31 pm
Forum: General Discussion and Questions
Topic: [Solved] Use of class Pin crash the pyboard
Replies: 8
Views: 4663

Re: [Solved] Use of class Pin crash the pyboard

The firmware is split into 2 pieces. 16k plus the rest.

This is because the lower flash blocks are smaller and better to use for the mass storage device.
by dhylands
Tue May 13, 2014 5:38 am
Forum: General Discussion and Questions
Topic: Irregular processing power
Replies: 21
Views: 12424

Re: Irregular processing power

Perhaps move the gc.disable to just before the loop?

I suspect that a hc during initialization is causing your memory error with gc disabled earlier.