2018-10-01 01:20 AM
hello i need to protect my code from reading or just protect the two first pages is enough because ill put my devices on market ?
i cliked on execute only code option in keil flash options
my code doesnt compile here is the error :
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(254): error: A1944E: Literal pool entries cannot be generated in execute-only sections
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(272): error: A1944E: Literal pool entries cannot be generated in execute-only sections
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(405): error: A1944E: Literal pool entries cannot be generated in execute-only sections
what should i do ???
Solved! Go to Solution.
2018-10-04 01:39 AM
prblm solved with st link utility
open option bytes
then select enable read out protection then download the new option byte by selecting apply .
then you will see if you try to connect to device it says that cannot read memory ..
2018-10-01 03:20 AM
> what should i do ???
Read the reference manual (Memory Protection part under the Flash section)?
The key words are RDP (Read Out Protection) and PcROP (Proprietary Code Read-Out Protection).
Or at least mention the microcontroller model so we can give you more precise directions or code examples.
2018-10-01 04:22 AM
yes, thanks im working on stm32f103cb of course i have read it ,
1- i told that i tried "execute only code" option ---->it make error on building
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(254): error: A1944E: Literal pool entries cannot be generated in execute-only sections
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(272): error: A1944E: Literal pool entries cannot be generated in execute-only sections
..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3\port.c(405): error: A1944E: Literal pool entries cannot be generated in execute-only sections
2-second solution is
//protect our code ********************
HAL_FLASH_OB_Unlock();
FLASH_OB_RDP_LevelConfig(OB_RDP_LEVEL_1);//read protection
HAL_FLASH_OB_Launch();
HAL_FLASH_OB_Lock();
this one doesnt recognize the FLASH_OB_RDP_LevelConfig function!!
---->ROVER_LORA\ROVER_LORA.axf: Error: L6218E: Undefined symbol FLASH_OB_RDP_LevelConfig (referred from main.o). even it is clearly defined on the "stm32f1xx_hal_flash_ex.c" file
2018-10-01 05:15 AM
> even it is clearly defined on the "stm32f1xx_hal_flash_ex.c" file
So, is this file included into the project? does it compile?
-- pa
2018-10-01 05:49 AM
no it make errors that i wrote for you up , thats why im asking this forum .
the "stm32f1xx_hal_flash_ex.c" file is in the project but it doesnt detect this function ???
2018-10-01 06:25 AM
for stm managers:
when we want to download any software , it send us again and again to our email even we clik to the link it deosnt download it just make you turn around and come back to this email then nothing download
Start your software download
This message contains graphics.
If you do not see the graphics, click here to view
2018-10-02 06:09 AM
Mister Pavel A. imentionned that im using stm32f103cb ,
does it allow this reading protection ??
2018-10-02 08:13 AM
With missing functions, make sure that stm32f1xx_hal_conf.h for your project calls out the components you want it to build/use.
>>i cliked on execute only code option in keil flash options
That's not a method to protect your code.
You want to use read-out protection, but it will make your part very difficult to debug and use in general. You'd want your code outputting debugging and telemetry data so you can understand what's going on, and likely have an interactive terminal mode so you can test/query operation. You should have a function to disengage read-out protection, and while it will mass-erase your device it can be less tedious than other methods to walk it out of the mode.
2018-10-02 11:48 AM
> does it allow this reading protection ??
If we can believe the reference, section 2.4.1 then yes.
-- pa
2018-10-02 11:49 PM
no i dont need debug , i finished my code i just want to protect it to put it on market !!!, it should be quite easy option , like microchip its very easy but in stm looks like big issue should be very basic option ,
i dont understand
so execute only code what is it done for ???