Burning program into pyboard.

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
316meng
Posts: 4
Joined: Mon Apr 18, 2016 7:33 am

Burning program into pyboard.

Post by 316meng » Mon May 09, 2016 4:02 am

I wrote some code with python ,and now I want to know is it possible burning my code into pyboard??

PS : My target is people can use my lib but they can't see my code. like I can import pyb lib and use it ,but I can't see the pyb'source.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Burning program into pyboard.

Post by Roberthh » Mon May 09, 2016 5:30 am

Hellp @316meng,
on Pyboard you can use frozen bytecode.
Instructions provided by @pythoncoder are here: http://forum.micropython.org/viewtopic.php?f=6&t=1776
It requires rebuilding micropython for PyBoard, which is easiest done in a Linux environment.
Best Regards

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Burning program into pyboard.

Post by kfricke » Mon May 09, 2016 9:53 am

Based on the fact that everyone can inspect the open-source code for the pyb online, the OP should rethink the request or describe the real intent behind his question.
Asking for closed-source possibilities in open-source project does not always yield satisfying answers.

Besides using frozen bytecode you can also use frozen modules. There people might not see the code as you cannot see the code of the pyb module 8-)

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Burning program into pyboard.

Post by deshipu » Mon May 09, 2016 9:58 am

Of course it's always trivial to disassemble any python code. And not that much harder with code written in other languages. So the whole code-hugging thing is moot.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Burning program into pyboard.

Post by SpotlightKid » Mon May 09, 2016 11:44 am

STM32F boards with Flash memory have the facility to protect the flash contents against reading them out with a debugger or similar. It doesn't work with MicroPython and I'm sceptical that it could be made to work.

Post Reply