Renesas M16C FAMILY Manual Pagina 5

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 11
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 4
this:
Tx
__{48)12)CMD)78)56)34}____
Unlock
To unlock the chip, we need to know the flash locking code that was last programmed into it. Most
development tools use either all zeros or all ones (0xff) for the default key, so if you don't know the
right key you can try those. Each chip reserves seven bytes near the end (high addresses) of the flash,
which vary by family:
Key Byte R8C M16C M32C R32C
1
0x00FFDF 0x0FFFDF 0xFFFFDF 0xFFFFFFE8
2
0x00FFE3 0x0FFFE3 0xFFFFE3 0xFFFFFFE9
3
0x00FFEB 0x0FFFEB 0xFFFFEB 0xFFFFFFEA
4
0x00FFEF 0x0FFFEF 0xFFFFEF 0xFFFFFFEB
5
0x00FFF3 0x0FFFF3 0xFFFFF3 0xFFFFFFEC
6
0x00FFF7 0x0FFFF7 0xFFFFF7 0xFFFFFFED
7
0x00FFFB 0x0FFFFB 0xFFFFB 0xFFFFFFEE
Always check the status after attempting to unlock the chip, to see if the key you provided is correct.
The unlock request is one byte 0xF5 followed by the address of key byte one (from the above table,
three bytes, least significant byte first), followed by the size of the key (0x07), followed by the seven
key bytes (in the order indicated by the above table):
Tx
__{F5)ADR0)ADR1)ADR2)07)KEY1)KEY2)KEY3)KEY4)KEY5)KEY6)KEY7}___
Rx
________________________________________________________
For example, to program an R8C/1B with a key of 45,F3,B0,A8,81,CC,01 we'd use these bytes to
unlock it:
Tx
__{F5)DF)FF)00)07)45)F3)B0)A8)81)CC)01}___
<_addr_> <_______key________>
To program an R32C with a key of 45,F3,B0,A8,81,CC,01 we'd need to provide a 32-bit address:
Tx
__{48)FF}{F5)E8)FF)FF)07)45)F3)B0)A8)81)CC)01}___
<MSB> <_addr_> <_______key________>
In my utilities, I try unlocking first all zeros, then all ones (0xff), stopping when I see the "correct key"
code in the status response.
Ok, now for the actual programming part. There are three command you need to know how to do -
erase, program, and verify. The programming sequence is to erase everything, then program the pages
you need to program, reading each one back to verify it got copied correctly.
Also, in my utilities I forcibly set the flash locking key in the image I'm downloading to be all zeros, in
case the tools don't set them to something meaningful. Also, I set the R8C watchdog byte to 0xff. If
you actually use these features, you can include command-line options to leave them alone or set them
to specific values.
Vista de pagina 4
1 2 3 4 5 6 7 8 9 10 11

Comentarios a estos manuales

Sin comentarios