Search found 11 matches

by Loxy618
Tue Jan 21, 2020 6:38 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 421

Re: Garbage Collection Not Working

Okay, I assume you had MICROPY_PY_GC enabled to use "import gc". I am trying to use MICROPY_ENABLE_GC. I will try your way and see. I'm not sure if that will make a difference
by Loxy618
Tue Jan 21, 2020 1:48 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 421

Re: Garbage Collection Not Working

Thanks, so each script will be standalone. If there is no way to free up memory after running a global script then we can work around that using functions. I tested by loading the following function into flash, then executed. def test(): try: c=[1]*1000 c[6]=6 if c[6]==6: c[8]=8 except: exit(0) test...
by Loxy618
Tue Jan 21, 2020 11:46 am
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 421

Re: Garbage Collection Not Working

Thanks stijn. So after further testing I think you are correct that the variables aren't going out of scope after the script finishes. Some of the code is as follows. const char test_script[] = "a=[1]*1000"; mp_script_exec(test_script); gc_collect_start(); gc_collect_end(); The variables in the scri...
by Loxy618
Mon Jan 20, 2020 10:07 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 421

Re: Garbage Collection Not Working

So I'm probably not using MP in the most common way. I'm running it on a M7 that normally will run a basic while(1) with c-code. We have scripts that can be remotely added and stored in flash. There are some events that occur that may require a script to be executed. When these events occur, we will...
by Loxy618
Mon Jan 20, 2020 9:50 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 421

Garbage Collection Not Working

Hello, I'm running a simple script. a=[1]*1000 The heap is getting used for the allocation (32K heap). At the end of the script I'm looking at the heap and see the memory is still allocated. I can run the same script infinite more times without any additional memory being allocated on the heap. It s...
by Loxy618
Thu Jan 16, 2020 10:47 pm
Forum: General Discussion and Questions
Topic: Heap Usage
Replies: 1
Views: 237

Heap Usage

Hello, currently I allocated python to use a 32K array as a the heap. I am trying to stress test the heap and want to understand how/when its used, how I can write scripts to cause it to get fully used so I can properly handle any exceptions.
by Loxy618
Fri May 03, 2019 7:21 pm
Forum: General Discussion and Questions
Topic: Assembler Errors
Replies: 3
Views: 422

Re: Assembler Errors

Specifically I'm getting arm-none-eabi-as: unrecognized option `-x' the flags I have are (these I was using for gcc) # Assembler flags env.Append(ASFLAGS = [ '-mthumb', '-x', 'assembler-with-cpp', '-c', '-mcpu=%s' % (ARCH), '-MD', '-MP', '-D__%s__' % (PART), '-Wa,-g', ]) I tried to remove some of th...
by Loxy618
Fri May 03, 2019 4:16 pm
Forum: General Discussion and Questions
Topic: Assembler Errors
Replies: 3
Views: 422

Assembler Errors

Trying to compile for a Arm Microcontroller. We are using the following in the makefile ... env['AS'] = 'arm-none-eabi-as' #use as cross compiler ... if we use 'gcc' instead of 'as' everything works as expected. The error we get when using 'as' is "receipt for target 'all' failed" Any help would be ...
by Loxy618
Thu Apr 25, 2019 12:50 pm
Forum: General Discussion and Questions
Topic: Adding more Exceptions
Replies: 16
Views: 8276

Re: Adding more Exceptions

Exceptions at the C level are really setjmp/longjmp (or conceptually similar). In C you raise an exception using nlr_raise: like so: https://github.com/micropython/micropython/blob/master/stmhal/extint.c#L143 To add a custom exception in C, you can just create an your exception as an object derived...