<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit MicrocontrollersのトピックRe: How to protect Flash with FLBPR??? (MC68HC908)</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126076#M908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Yo,&lt;/P&gt;&lt;P&gt;You've declared your area MyROM, OK.... But you need to tell the compiler which variable/constant you want to put there !&lt;/P&gt;&lt;P&gt;In the C code, I want for instance to declare a global variable, I would do like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code: main.c&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;#pragma DATA_SEG MyROMtU08 ResetCounter;#pragma DATA_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only ResetCounter will go to MyROM and&amp;nbsp;then I&amp;nbsp;switch back to default Data space.&lt;/P&gt;&lt;P&gt;Alban.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Aug 2006 15:17:58 GMT</pubDate>
    <dc:creator>Alban</dc:creator>
    <dc:date>2006-08-10T15:17:58Z</dc:date>
    <item>
      <title>How to protect Flash with FLBPR??? (MC68HC908)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126072#M904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to protect my flash with the FLBPR register. The datasheet says: "The range of the protected area starts from a location defined by FLBPR and ends to the bottom of the FLASH memory ($FFFF)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I can only protect an area at the end of the flash-addressspace. Unfortunately my program-code is stored at the beginning of the flash-addressspace. The free pages I could use for my data are at the end. How can I then protected the program-code from being over-written by mistake? As far as I know it's not possible to de- and reactivate the protection. So I need to place the program-code at the end of the flash-addressspace and use the beginning for my data. But how can I configure this with CodeWarrior?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Soror&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 20:45:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126072#M904</guid>
      <dc:creator>Soror</dc:creator>
      <dc:date>2006-08-08T20:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to protect Flash with FLBPR??? (MC68HC908)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126073#M905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi Soror,&lt;/P&gt;&lt;P&gt;The spaces where Data and Code will be placed in the MCU are in the linker paramter file or PRM file.&lt;/P&gt;&lt;P&gt;In the prm file of your project, just change the addresses to the wished location.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;SEGMENTS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */  Z_RAM     = READ_WRITE 0x0040 TO 0x00EF;  RAM1      = READ_WRITE 0x0100 TO 0x043F;  RAM2      = READ_WRITE 0x0580 TO 0x097F;  ROM1      = READ_ONLY  0x0462 TO 0x04FF;  ROM2      = READ_ONLY  0x0980 TO 0x1B7F;  &lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;ROM3      = READ_ONLY  0x1E20 TO 0xFDFF;&lt;/FONT&gt;&lt;/STRONG&gt;//OSVECTORS = READ_ONLY  0xFFCC TO 0xFFFF;  /* OSEK interrupt vectors (use your vector.o) */  ENDPLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. *///.ostext,                                      /* OSEK */  DEFAULT_ROM                   INTO /*ROM1, ROM2,*/ &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;ROM3&lt;/STRONG&gt;&lt;/FONT&gt;;  /* in case you want to use ROM1/ROM2 here as well, add option -OnB=b to the compiler. */  DEFAULT_RAM                   INTO RAM1, RAM2;  _DATA_ZEROPAGE, MY_ZEROPAGE   INTO Z_RAM;//VECTORS_DATA                  INTO OSVECTORS; /* OSEK */END&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Declare a Zone DATA you can map to another ROM area you don't protect.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To reset the FLBPR value to 0xFF, you need to do a MASS ERASE.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Alban.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 21:18:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126073#M905</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-08-08T21:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to protect Flash with FLBPR??? (MC68HC908)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126074#M906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Alban,&lt;BR /&gt;&lt;BR /&gt;thanks a lot :-)! That's exactly what I am looking for!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Soror&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 21:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126074#M906</guid>
      <dc:creator>Soror</dc:creator>
      <dc:date>2006-08-08T21:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to protect Flash with FLBPR??? (MC68HC908) b</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126075#M907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Alban,&lt;BR /&gt;&lt;BR /&gt;I still have some problems. I tried to change my prm to this:&lt;BR /&gt;&lt;BR /&gt;SECTIONS&lt;BR /&gt; ROM = READ_ONLY 0xF840 TO 0xFDFF;&lt;BR /&gt; Z_RAM = READ_WRITE 0x0080 TO 0x00FF;&lt;BR /&gt; InterruptVectors_ROM = READ_ONLY 0xFFDE TO 0xFFFF;&lt;BR /&gt; MyROM = READ_ONLY 0xF800 TO 0xF83F;&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;PLACEMENT&lt;BR /&gt; DEFAULT_RAM INTO Z_RAM;&lt;BR /&gt; DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM;&lt;BR /&gt; _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM;&lt;BR /&gt; DATAFLASH INTO MyROM;&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;I couldn't name the zone DATA. With DATA I got a linker-error a sectionname would be expected. So I called the zone DATAFLASH.&lt;BR /&gt;&lt;BR /&gt;But I receive an error during runtime:&lt;BR /&gt;&lt;BR /&gt;Error: At location F83F - &lt;BR /&gt;Error: Attempt to use invalid or uninitialized memory&lt;BR /&gt;&lt;BR /&gt;The code is:&lt;BR /&gt;&lt;BR /&gt;unsigned char flashByte[64] @ 0xF800;&lt;BR /&gt;&lt;BR /&gt;if ( flashByte[i] == 0xFF ) /* i=63 */&lt;BR /&gt;&lt;BR /&gt;=&amp;gt; Translated in "LDX 63488,X", which produces the error.&lt;BR /&gt;&lt;BR /&gt;If I point the array flashByte to the "ROM" area 0xF83F it works fine.( unsigned char flashByte[64] @ 0xF83F; ) But it doesnt work with my DATAFLASH address-space.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regrads,&lt;BR /&gt;&lt;BR /&gt;Soror&lt;P&gt;Message Edited by Soror on &lt;SPAN class="date_text"&gt;2006-08-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:08 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Soror on &lt;SPAN class="date_text"&gt;2006-08-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:09 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Soror on &lt;SPAN class="date_text"&gt;2006-08-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:10 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Soror on &lt;SPAN class="date_text"&gt;2006-08-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:18 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 15:08:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126075#M907</guid>
      <dc:creator>Soror</dc:creator>
      <dc:date>2006-08-10T15:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to protect Flash with FLBPR??? (MC68HC908)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126076#M908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Yo,&lt;/P&gt;&lt;P&gt;You've declared your area MyROM, OK.... But you need to tell the compiler which variable/constant you want to put there !&lt;/P&gt;&lt;P&gt;In the C code, I want for instance to declare a global variable, I would do like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code: main.c&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;#pragma DATA_SEG MyROMtU08 ResetCounter;#pragma DATA_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only ResetCounter will go to MyROM and&amp;nbsp;then I&amp;nbsp;switch back to default Data space.&lt;/P&gt;&lt;P&gt;Alban.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 15:17:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126076#M908</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-08-10T15:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to protect Flash with FLBPR??? (MC68HC908)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126077#M909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;THANKS! now it's working.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Soror&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 15:34:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-protect-Flash-with-FLBPR-MC68HC908/m-p/126077#M909</guid>
      <dc:creator>Soror</dc:creator>
      <dc:date>2006-08-10T15:34:47Z</dc:date>
    </item>
  </channel>
</rss>

