Search found 17 matches

by usjcarkm
Tue Sep 15, 2015 8:28 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

A pull request for the nios2 port code to go into the main micropython code base is here:
https://github.com/micropython/micropython/pull/1463

The full main micropython code base with the nios2 branch is here in the meantime:
https://github.com/bitmachinejc/micropy ... tree/nios2

Regards
by usjcarkm
Tue Jun 30, 2015 7:59 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Hello,

I will post code asap.

Yes, I am newer dev board, but it should work on that version as well.

I am also using Windows and the Nios Eclipse IDE with the Nios cygwin cmd shell.
I typically build in the Nios cygwin cmd shell, but you can also build in the IDE.

Regards
by usjcarkm
Mon Jun 22, 2015 9:58 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Found that in the do_str() function needed to replace MP_PARSE_SINGLE_INPUT with MP_PARSE_FILE_INPUT. This will parse the input string as though it were a file, instead of a single line.
by usjcarkm
Mon Jun 22, 2015 9:57 pm
Forum: General Discussion and Questions
Topic: Running a multi line python script from memory
Replies: 2
Views: 2259

Re: Running a multi line python script from memory

Thanks. Worked great.
I also mistyped the the print line. Should enclose the param as shown below:

Code: Select all

count = 0
while count < 5:
 print(count)
 count += 1
by usjcarkm
Mon Jun 22, 2015 7:16 pm
Forum: General Discussion and Questions
Topic: Running a multi line python script from memory
Replies: 2
Views: 2259

Running a multi line python script from memory

Hello, Is there a way to run a multi line python script from memory (not from a File, since my embedded op system doesn't support this and also don't need it) ? Is there a form that takes a char* of the multi line python script itself versus a file name ? I don't have files, just the script in memor...
by usjcarkm
Mon Jun 22, 2015 5:42 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Thanks, Is there another form that takes a char* of the multi line python script itself instead of a file name ? I don't have files, just the script in memory (hard coded in a const char* for now, but could also be received from a socket at some point) I won't be able to use this form, I believe: in...
by usjcarkm
Fri Jun 19, 2015 7:25 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Hello, I am pretty happy with the Altera NIOS 2 port. So far things are working as expected. What steps are needed to get the code to the micropython github repository, so others can try ? On a side note, my application requires to load a python script from memory and run it. I've successfully teste...
by usjcarkm
Wed Jun 17, 2015 3:35 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Yes it should. Any Altera NIOS 2 platform should be fine. I am using the Cyclone 3 and 5.

Once I prove a few things out, perhaps the code can be uploaded to the shared repository.
by usjcarkm
Tue Jun 16, 2015 6:40 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

Thanks. Yes that did it ! I now I have an fully build elf file that appears to run on the device. My main.c has the same codebase as the one in the minimal folder, apart from allowing this line to additionally run. do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')"); I now ne...
by usjcarkm
Tue Jun 16, 2015 3:08 pm
Forum: Other Boards
Topic: MicroPython on Altera NIOS 2
Replies: 29
Views: 10979

Re: MicroPython on Altera NIOS 2

I was able to resolve some of the linker errors by setting the LIBS item in the makefile to the path to the libgcc.a: LIBS = C:/altera/12.1sp1/nios2eds/bin/gnu/H-i686-mingw32/lib/gcc/nios2-elf/4.1.2/libgcc.a Here is the current compiler output. A few linker errors remain: $ make V=1 python ../py/mak...