View previous topic :: View next topic |
Author |
Message |
hello188
Joined: 02 Jun 2010 Posts: 74
|
"const" variable and EBTR fuse |
Posted: Mon Oct 15, 2012 12:24 am |
|
|
Hi.
I noticed that if I enable EBTR bit in the fuse, the read from const variable in the program from certain variable just fails.
Does "Memory protected from table reads" mean that const variable can not be read from program memory correctly??
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19480
|
|
Posted: Mon Oct 15, 2012 12:50 am |
|
|
Yes.
The table read instruction, is what is used to access const values.
This allows one part of the code, to read a value stored elsewhere in the ROM. The 'security' implications are that if someone manages to write code into your chip, then this code can read the contents of the rest of memory.
However they have to have written code into the chip to do this, and there are other fuses to prevent this.
Best Wishes |
|
|
hello188
Joined: 02 Jun 2010 Posts: 74
|
|
Posted: Tue Nov 13, 2012 12:14 am |
|
|
Hi.
I also noticed that I have to disable EBTRB bit along with EBTR to get proper const variable reading.
Does CCS-C compiler put constant variables into boot block?? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19480
|
|
Posted: Tue Nov 13, 2012 2:30 am |
|
|
If you are not using it for a bootloader, then 'yes', of course.
It is not a 'bootblock', unless you define it as such. Otherwise it is just the low part of the program memory.
Best Wishes |
|
|
|