STM32F4xx firmware protection
I am developing some products based on STM32F407/STM32F429. What I am trying to do is to protect my firmware that:
- simply dump the code from one chip's flash (to hex file) will not work in another chip
- moderate reverse engineering should not be that easy to hack the code
And what I am trying to do is use mbedtls as a crypto library and encrypt part of my code then store it in some flash sector. Then each time when I boot, decrypt the code into SRAM2 and point the function to that region.
It is a good idea to do that? and I have tried to copy the function from flash 0x0800xxxx to SRAM2 (0x2001C000) and made a function pointer to that region. but call the function caused HardFault exception.
