Page 1 of 1
execute the program on eCore twice
Posted:
Tue Sep 23, 2014 3:43 am
by howardhh
Hi all,
In my program, I want to run the program on eCore twice. But it always stop at the second loop.
Do I have to reset the group each loop? Or something is wrong with the local memory at the second loop?
Any suggestion?
Thanks!
Re: execute the program on eCore twice
Posted:
Tue Sep 23, 2014 6:57 am
by timpart
When the core program returns from main, it executes TRAP and stops. This will be fixed in a future SDK release .
Tim
Re: execute the program on eCore twice
Posted:
Tue Sep 23, 2014 8:28 am
by notzed
You could try just ending your main in "while(1);"; it will use more power when idle but should let e_start() reset the chip and re-call main(). Or just call e_reset_group() or e_resume() before calling e_start(). e_resume() will continue after a trap but it might be in a loop iirc.
Also note that data will not be reset so any static initialisers will appear not to be run. And only bss off-core will be cleared (if the linker script defines any).
Re: execute the program on eCore twice
Posted:
Tue Sep 23, 2014 1:40 pm
by howardhh
Thanks for your suggestion!
Actually, e_reset can make the program work. But I have just tried e_resume(), which also stops at the second loop.
Does this mean I have to call e_reset_group() in the loop? Is there any other way?
I think my problem is quite similar with stevenc.
Re: execute the program on eCore twice
Posted:
Wed Sep 24, 2014 12:29 am
by aihaike
I just try to do a e_reset_group before the e_start_group, and it works fine.
I see it as a trick in cause the program executes TRAP and stops as timpart mentioned.
To me we loose time doing so, and hopefully this will be fixed.
Re: execute the program on eCore twice
Posted:
Wed Sep 24, 2014 2:58 am
by notzed
Re: execute the program on eCore twice
Posted:
Wed Sep 24, 2014 6:24 am
by howardhh
Thank you, notzed!
I think e_reset_group() should be fine for the moment~
Re: execute the program on eCore twice
Posted:
Wed Sep 24, 2014 6:25 am
by aihaike
@notzed you are absolutely right, and it works fine that way anyway.