RP2040 Copy code from chip?

Looking at using the RP2040 chip I've read that coping code is a concern where others could copy and then duplicate your work (with needed hardware of course). Anything that others have done to make this more difficult. I know at the end of the day reverse engineering what your device does is always possible. Using the 328p chip this was a very low concern. If I use a RP2040 should I be concerned?

Why would the level of concern be different for different processors ?

With the atmega328, the flash memory is onboard the chip and I believe there is a fuse bit that can be set to prevent reading back the contents.

With RP2040, the flash chip is external, so I guess there is ultimately no way to protect it: the flash chip itself could be removed and put into another circuit to allow the contents to be read out if necessary (which it probably isn't).

At least with the Arduino IDE, only the compiled code is uploaded to that flash chip. It can be copied but not easily updated or enhanced, because decompiling the uploaded code back into C/C++ results in code that is pretty unreadable to humans. A bit like taking a document that had been shredded and sticking it back together again! Easier to re-write the code from scratch than to do that.

With other languages like Python, the source code itself is uploaded to flash, so it's there for anyone to read. I suppose you could "pickle" the Python code to prevent that.

So just "glue" it down would make it more secure then from being copied. Even 328 can be hacked so it isn't like I have any top secret code that couldn't be figured out, but just trying to make it more difficult. Cost of the boards and availability are moving me this direction but still early stages and about to test my code on a board with the RP2040.

So just "glue" it down would make it more secure

Note that you'd be "gluing down" the flash chip, not the rp2040 itself. Well, perhaps ALL of it; you need to prevent people from accessing the connections over which the flash chip is accessible.


In the Arduino world, we believe in open source, and it's pretty un-common to "lock down" device firmware, even when the CPU hardware allows it.

Your "product" would need to be significantly popular and not requiring of much "support" in order for it to be worth copying.

All that said, it ought to be possible to implement a second-stage (third-stage?) bootloader for rp2040 that kept the content of the flash chip "encrypted" to deter copying of the software. To do this well would require some sort of private key storage that would add significant cost and complexity to your product. Do it poorly, and perhaps someone will try to extort ransom from your company to "not publish" how to get around it. (like the last time I tried to implement an encryption algorithm! :frowning: )

I think you mean programming with python. These programs can be copied easily because the code is unprotected kept on the Pi.
If you write in for instance C and compile the program, I think it dous not make a difference with other boards.