get parse fault to call py function after garbage collection
Posted: Thu Jan 08, 2015 8:13 am
Environment :
OS is FreeRTOS and board is not pyboard.
do_str/do_file/garbage collection is ported to this.
basically do file and do_str work. garbage collection also works in general situation.
But I got HardFault to call do_str with a little complicate string just after garbage collection occurs.
My code(1) is as follows.
testcode.py has function implementation of "function_A"
do_str() works correctly repeatedly
But just after garbage collection, it get HardFault.
--(1)-----------------------------------------------------------------
do_file("/testcode.py");
while (1) {
do_str("globals()[\'function_A\'](\"on\")");
}
----------------------------------------------------------------------
for comparing, this code(2) works well also after garbage collection occurs.
The difference is how to call the function - whether call with function name or function pointer taken globals() with it's function name.
--(2)-----------------------------------------------------------------
do_file("/testcode.py");
while (1) {
do_str("function_A(\"on\")");
}
----------------------------------------------------------------------
(1) actually has several(3) python operation within it. could it makes issue with gc?
The section for garbage collector search is BSS, Data, Stack, register.
Could you give some opinion?
Thank you for reading this.
OS is FreeRTOS and board is not pyboard.
do_str/do_file/garbage collection is ported to this.
basically do file and do_str work. garbage collection also works in general situation.
But I got HardFault to call do_str with a little complicate string just after garbage collection occurs.
My code(1) is as follows.
testcode.py has function implementation of "function_A"
do_str() works correctly repeatedly
But just after garbage collection, it get HardFault.
--(1)-----------------------------------------------------------------
do_file("/testcode.py");
while (1) {
do_str("globals()[\'function_A\'](\"on\")");
}
----------------------------------------------------------------------
for comparing, this code(2) works well also after garbage collection occurs.
The difference is how to call the function - whether call with function name or function pointer taken globals() with it's function name.
--(2)-----------------------------------------------------------------
do_file("/testcode.py");
while (1) {
do_str("function_A(\"on\")");
}
----------------------------------------------------------------------
(1) actually has several(3) python operation within it. could it makes issue with gc?
The section for garbage collector search is BSS, Data, Stack, register.
Could you give some opinion?
Thank you for reading this.