Search found 15 matches

by fnord
Mon Sep 28, 2020 8:36 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Whereas the following code causes the program to crash: It sounds like the GC is crashing. I initially wondered if it was filling up the entire heap with QSTR pools, but I don't think that exact code will result in any QSTRs being created (only strings which can be GC'ed). Any chance you can post w...
by fnord
Fri May 22, 2020 7:03 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

I tried to reproduce this in the embedding example, and it indeed happens there, too. Adding the following to hello-embed.c: // heap exhaustion test const char str_heaptest[] = "import gc\n" "for i in range(1000):\n" " print(\"mem: %d / %d\"%(gc.mem_alloc(), gc.mem_free()))"; if (execute_from_str(st...
by fnord
Fri May 22, 2020 6:21 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Okay, I looked a bit more into the hard fault issue I described above. The crash does indeed happen when I run out of heap space, or whenever I call gc.collect(). When I disable the garbage collector with gc.disable(), I get a MemoryError exception instead of the hard fault, when I run out of heap. ...
by fnord
Tue May 19, 2020 10:56 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Okay, here it is: https://github.com/fnordsh/dmpy
If you have any questions, let me know!
by fnord
Mon May 18, 2020 9:06 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Yes, I intend to put what I have so far on github, just haven't found the time to do so yet. I'll probably need to fork micropython so I can include it as a git submodule with my changes to the micropython code. I hope I'll be able to do make my code available in the course of this week; sorry for t...
by fnord
Wed May 06, 2020 8:37 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Hi again, I found a reliable way to crash my program, but I'm not sure what do do about it. The following python code does nothing interesting but works: for i in range(100): s = "%d"%i Whereas the following code causes the program to crash: for i in range(1000): s = "%d"%i Note that the error messa...
by fnord
Sun May 03, 2020 7:50 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Status update:
I can read and execute .py files and also import modules from the DMCP filesystem.
Also, I have an error screen for uncaught exceptions.
exception.png
Exception screen
exception.png (2.19 KiB) Viewed 5987 times
by fnord
Tue Apr 28, 2020 8:01 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Yes, it really helped a lot, thank you! The current status is: My main program reads a file called test.py from the calculator's FAT filesystem into a buffer and then calls execute_from_str(buffer). I have started working on a module called dmcp that tries to match the DMCP c api as closely as possi...
by fnord
Sun Apr 26, 2020 12:50 pm
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

First signs of life :-)
by fnord
Sun Apr 26, 2020 11:53 am
Forum: Development of MicroPython
Topic: Porting MicroPython to SwissMicros DM42 / DMCP
Replies: 21
Views: 15435

Re: Porting MicroPython to SwissMicros DM42 / DMCP

Okay, after fixing that, I get: arm-none-eabi-gcc -c -mthumb -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" -Idmcp -Isrc -Wall -fdata-sections -ffunction-sections -Wno-misleading-indentation -I/home/fnord/data/Develop/DMPY...