This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
We have configured the Internal flash to different regions A,B,C,D. A is our first region and jump to region B after doing some stuff. We are trying to configure MPU in region A. It jumps to region B and works fine when we configure complete internal flash of size 4MB to read write first. And if we configure region C and D as read only, we end up in some exception or doesn't move to region B. So, is there any restriction or limitation that we have to configure complete 4mb as read write/read only initially or can we configure all the regions in any way we want ?
There should be no overlapping regions and that the regions are ordered correctly. The MPU on the TMS570LC4357 processes regions in order, and overlapping regions can lead to unexpected behavior.
HI Nasir,
Thanks for the response. One more query related to the same ::
I have configured Internal flash 4mb to Read Only. But we program the internal flash using F021 driver. and it works fine. Is there any setting of F021 which will override the memory configuration of internal flash ?
Hi Bharat,
Your observation is correct.
The MPU is located in CPU. Your MPU settings can protect the flash from CPU write, but when the Flash API is used to program (write) to the flash, the CPU does not directly write to the Flash address. The physical write to the flash is performed by the Flash State Machine in the flash wrapper.
Please refer below two threads to understand in more details:
--
Thanks & Regards,
Jagadish.
Hi Jagadish,
Thanks for the response.
In the link you have shared, response to flash protection is as below:
'In the flash configuration, there is way to protect sector or even bank to be erase or programmed.
If a sector or bank is accessed for program or erase, the flash API will return an error, and your application will have to take care of it.'
Please let me how to achieve sector erase or program protection through flash configuration
Hi Bharath,
Please let me how to achieve sector erase or program protection through flash configuration
You can do this using the FBPORT and FBSE registers.
If PROTL1DIS bit in the FBPORT register cleared then Level-1 protection will be enabled, if this protection enabled then it is not possible to enable the required sectors in the FBSE register for erasing and writing.
And if we call any write or erase command directly without disabling this protection bit and/or without enabling the sector bits then we will get below highlighted error.
--
Thanks & regards,
Jagadish.