Compare commits

...

13 Commits

Author SHA1 Message Date
  Jim Paris b7f9ffb6c0 cc2538 flash: fix up flash address base confusion 4 years ago
  Jim Paris e300b037bb cc2538 flash driver: fix buffer location 4 years ago
  Jim Paris 6471cdda6c cc2538 algo: fix erase check 4 years ago
  Jim Paris 249ff6e0e1 cc2538 algo: erase CCA first when erasing the full chip 4 years ago
  Jim Paris 520f30c027 cc2538 algo: add programming support 4 years ago
  Jim Paris 187622d980 cc2538 algo: don't bother erasing already-empty pages 4 years ago
  Jim Paris a49dc8cb68 cc2538 algo: use flash_erase_sector for flash_bulk_erase 4 years ago
  Jim Paris a420d45a8f Use real algorithm in cc2538 flash driver 4 years ago
  Jim Paris b65894768f Add initial flash algorithm implementation for cc2538 4 years ago
  Jim Paris dc433c679a Add initial CC2538 flash driver with dummy algorithm 4 years ago
  daniel-k 90afcfbe60 rtos: add support for RIOT 8 years ago
  Marc Schink 7d90c6c91b Add initial RTT support (WIP+RFC) 7 years ago
  Jim Paris f92d7174cc target/arm_adi_v5: power off chip debug hardware on shutdown 5 years ago
34 changed files with 3959 additions and 6 deletions
Split View
  1. +2
    -0
      contrib/loaders/flash/cc2538/.gitignore
  2. +35
    -0
      contrib/loaders/flash/cc2538/Makefile
  3. +91
    -0
      contrib/loaders/flash/cc2538/cc2538.lds
  4. +833
    -0
      contrib/loaders/flash/cc2538/cc2538_algo.inc
  5. +109
    -0
      contrib/loaders/flash/cc2538/flash.c
  6. +61
    -0
      contrib/loaders/flash/cc2538/flash.h
  7. +117
    -0
      contrib/loaders/flash/cc2538/flashloader.c
  8. +143
    -0
      contrib/loaders/flash/cc2538/flashloader.h
  9. +116
    -0
      contrib/loaders/flash/cc2538/main.c
  10. +37
    -0
      contrib/loaders/flash/cc2538/startup.s
  11. +3
    -1
      src/Makefile.am
  12. +2
    -0
      src/flash/nor/Makefile.am
  13. +435
    -0
      src/flash/nor/cc2538.c
  14. +62
    -0
      src/flash/nor/cc2538.h
  15. +2
    -0
      src/flash/nor/drivers.c
  16. +9
    -0
      src/openocd.c
  17. +4
    -1
      src/rtos/Makefile.am
  18. +414
    -0
      src/rtos/riot.c
  19. +3
    -1
      src/rtos/rtos.c
  20. +95
    -0
      src/rtos/rtos_riot_stackings.c
  21. +32
    -0
      src/rtos/rtos_riot_stackings.h
  22. +2
    -0
      src/rtt/Makefile.am
  23. +521
    -0
      src/rtt/rtt.c
  24. +119
    -0
      src/rtt/rtt.h
  25. +3
    -1
      src/server/Makefile.am
  26. +182
    -0
      src/server/rtt_server.c
  27. +26
    -0
      src/server/rtt_server.h
  28. +5
    -2
      src/target/Makefile.am
  29. +20
    -0
      src/target/arm_adi_v5.c
  30. +3
    -0
      src/target/arm_adi_v5.h
  31. +2
    -0
      src/target/cortex_m.c
  32. +413
    -0
      src/target/rtt.c
  33. +46
    -0
      src/target/rtt.h
  34. +12
    -0
      tcl/target/cc2538.cfg

+ 2
- 0
contrib/loaders/flash/cc2538/.gitignore View File

@@ -0,0 +1,2 @@
*.bin
*.out

+ 35
- 0
contrib/loaders/flash/cc2538/Makefile View File

@@ -0,0 +1,35 @@
BIN2C = ../../../../src/helper/bin2char.sh

CROSS_COMPILE ?= arm-none-eabi-
GCC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy

FLAGS = -mthumb -Os -ffunction-sections -fdata-sections -g -gdwarf-3
FLAGS += -gstrict-dwarf -Wall -fno-strict-aliasing --asm
CFLAGS = -c -I. -mcpu=cortex-m3

OBJS := flashloader.o main.o startup.o flash.o

all: cc2538_algo.inc

%.o: %.c
$(GCC) $(FLAGS) $(CFLAGS) -o $@ $<

%.o: %.s
$(GCC) $(FLAGS) $(CFLAGS) -o $@ $<

cc2538_algo.out: $(OBJS)
$(GCC) $(FLAGS) -o $@ $^ -Wl,-T"cc2538.lds"

%.bin: %.out
$(OBJCOPY) -Obinary $< $@

%.inc: %.bin
$(BIN2C) < $< > $@ || (rm -f $@ ; false)

clean:
rm -f *.inc *.bin *.out *.map *.o *.d

.PRECIOUS: %.bin

.PHONY: all clean

+ 91
- 0
contrib/loaders/flash/cc2538/cc2538.lds View File

@@ -0,0 +1,91 @@
/******************************************************************************
*
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

/* Entry Point */
ENTRY( entry )

/* System memory map */
MEMORY
{
/* Application is stored in and executes from SRAM */
PROGRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x1000
STACK (RWX) : ORIGIN = 0x20001000, LENGTH = 0x0BD8
BUFFERS (RWX) : ORIGIN = 0x20001BD8, LENGTH = 0x3028
}

/* Section allocation in memory */
SECTIONS
{
.text :
{
_text = .;
*(.entry*)
*(.text*)
_etext = .;
} > PROGRAM

.data :
{ _data = .;
*(.rodata*)
*(.data*)
_edata = .;
}

.bss :
{
__bss_start__ = .;
_bss = .;
*(.bss*)
*(COMMON)
_ebss = .;
__bss_end__ = .;
} > PROGRAM

.stack :
{
_stack = .;
. = . + LENGTH(STACK);
_estack = .;
} > STACK

.buffers :
{
_buffers = .;
*(.buffers.g_cfg)
*(.buffers.g_buf1)
*(.buffers.g_buf2)
*(.buffers*)
_ebuffers = .;
} > BUFFERS
}

+ 833
- 0
contrib/loaders/flash/cc2538/cc2538_algo.inc View File

@@ -0,0 +1,833 @@
/* Autogenerated with ../../../../src/helper/bin2char.sh */
0x72,0xb6,0x4f,0xf0,0x00,0x00,0x80,0xf3,0x14,0x88,0xbf,0xf3,0x6f,0x8f,0x09,0x48,
0x85,0x46,0xbf,0xf3,0x6f,0x8f,0x4f,0xf0,0x00,0x00,0x07,0x49,0x07,0x4a,0x91,0x42,
0xb8,0xbf,0x41,0xf8,0x04,0x0b,0xfa,0xdb,0x00,0xf0,0x1a,0xfa,0x00,0xf0,0x3e,0xf9,
0xfe,0xe7,0x00,0x00,0xd8,0x1b,0x00,0x20,0x44,0x0b,0x00,0x20,0x68,0x0c,0x00,0x20,
0x06,0x48,0x07,0x4b,0x10,0xb5,0x83,0x42,0x04,0xd0,0x06,0x4b,0x00,0x2b,0x01,0xd0,
0x00,0xf0,0x4e,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0x40,0x0b,0x00,0x20,
0x40,0x0b,0x00,0x20,0x00,0x00,0x00,0x00,0x08,0x48,0x09,0x49,0x09,0x1a,0x89,0x10,
0xcb,0x0f,0x59,0x18,0x10,0xb5,0x49,0x10,0x04,0xd0,0x06,0x4b,0x00,0x2b,0x01,0xd0,
0x00,0xf0,0x36,0xf8,0x10,0xbc,0x01,0xbc,0x00,0x47,0xc0,0x46,0x40,0x0b,0x00,0x20,
0x40,0x0b,0x00,0x20,0x00,0x00,0x00,0x00,0x10,0xb5,0x08,0x4c,0x23,0x78,0x00,0x2b,
0x09,0xd1,0xff,0xf7,0xcd,0xff,0x06,0x4b,0x00,0x2b,0x02,0xd0,0x05,0x48,0xaf,0xf3,
0x00,0x80,0x01,0x23,0x23,0x70,0x10,0xbc,0x01,0xbc,0x00,0x47,0x44,0x0b,0x00,0x20,
0x00,0x00,0x00,0x00,0xe8,0x06,0x00,0x20,0x06,0x4b,0x10,0xb5,0x00,0x2b,0x03,0xd0,
0x05,0x49,0x06,0x48,0xaf,0xf3,0x00,0x80,0xff,0xf7,0xc6,0xff,0x10,0xbc,0x01,0xbc,
0x00,0x47,0xc0,0x46,0x00,0x00,0x00,0x00,0x48,0x0b,0x00,0x20,0xe8,0x06,0x00,0x20,
0x18,0x47,0xc0,0x46,0xd4,0x30,0x9f,0xe5,0x00,0x00,0x53,0xe3,0xc8,0x30,0x9f,0x05,
0x03,0xd0,0xa0,0xe1,0x00,0x20,0x0f,0xe1,0x0f,0x00,0x12,0xe3,0x15,0x00,0x00,0x0a,
0xd1,0xf0,0x21,0xe3,0x03,0xd0,0xa0,0xe1,0x01,0xaa,0x4d,0xe2,0x0a,0x30,0xa0,0xe1,
0xd7,0xf0,0x21,0xe3,0x03,0xd0,0xa0,0xe1,0x01,0x3a,0x43,0xe2,0xdb,0xf0,0x21,0xe3,
0x03,0xd0,0xa0,0xe1,0x01,0x3a,0x43,0xe2,0xd2,0xf0,0x21,0xe3,0x03,0xd0,0xa0,0xe1,
0x02,0x3a,0x43,0xe2,0xd3,0xf0,0x21,0xe3,0x03,0xd0,0xa0,0xe1,0x02,0x39,0x43,0xe2,
0xff,0x30,0xc3,0xe3,0xff,0x3c,0xc3,0xe3,0x04,0x30,0x03,0xe5,0x00,0x20,0x53,0xe9,
0xc0,0x20,0x82,0xe3,0x02,0xf0,0x21,0xe1,0x01,0xa8,0x43,0xe2,0x00,0x10,0xb0,0xe3,
0x01,0xb0,0xa0,0xe1,0x01,0x70,0xa0,0xe1,0x5c,0x00,0x9f,0xe5,0x5c,0x20,0x9f,0xe5,
0x00,0x20,0x52,0xe0,0x01,0x30,0x8f,0xe2,0x13,0xff,0x2f,0xe1,0x00,0xf0,0x92,0xf9,
0x10,0x4b,0x00,0x2b,0x01,0xd0,0xfe,0x46,0x9f,0x46,0x0f,0x4b,0x00,0x2b,0x01,0xd0,
0xfe,0x46,0x9f,0x46,0x00,0x20,0x00,0x21,0x04,0x00,0x0d,0x00,0x0d,0x48,0x00,0xf0,
0x1b,0xf9,0x00,0xf0,0x55,0xf9,0x20,0x00,0x29,0x00,0x00,0xf0,0x77,0xf8,0x00,0xf0,
0x1d,0xf9,0x7b,0x46,0x18,0x47,0x00,0x00,0x11,0x00,0x00,0xef,0x00,0x00,0x08,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x0b,0x00,0x20,
0x68,0x0c,0x00,0x20,0x25,0x04,0x00,0x20,0x38,0xb5,0x0d,0x46,0x14,0x46,0x00,0x21,
0x28,0x22,0x00,0xf0,0x5f,0xf9,0x4f,0xf4,0x80,0x72,0x05,0x61,0x44,0x62,0x00,0x21,
0x02,0x48,0x00,0xf0,0x57,0xf9,0x00,0x20,0x38,0xbd,0x00,0xbf,0x60,0x0b,0x00,0x20,
0x10,0xb5,0x00,0xf0,0xbd,0xf8,0x04,0x46,0x38,0xb9,0x4f,0xf4,0x80,0x72,0x01,0x21,
0x03,0x48,0x00,0xf0,0x47,0xf9,0x20,0x46,0x10,0xbd,0x40,0xf2,0x01,0x14,0xfa,0xe7,
0x60,0x0b,0x00,0x20,0xb0,0xf5,0x00,0x1f,0xf8,0xb5,0x21,0xd3,0x01,0x44,0xb1,0xf5,
0x20,0x1f,0x1d,0xd8,0x01,0x27,0xa1,0xf5,0x00,0x11,0xa0,0xf5,0x00,0x10,0x01,0x39,
0x0d,0x4e,0xc4,0x0a,0xcd,0x0a,0xac,0x42,0x01,0xd9,0x00,0x20,0x0c,0xe0,0xa3,0x5d,
0x63,0xb9,0x20,0x46,0x00,0xf0,0x6e,0xf8,0x38,0xb1,0x00,0x04,0x00,0xf4,0x7f,0x00,
0x40,0xea,0x04,0x60,0x40,0xf4,0x81,0x70,0xf8,0xbd,0xa7,0x55,0x01,0x34,0xea,0xe7,
0x4f,0xf4,0x82,0x70,0xf8,0xe7,0x00,0xbf,0x60,0x0b,0x00,0x20,0xb1,0xf5,0x00,0x1f,
0x10,0xb5,0x0b,0x46,0x07,0xd3,0x13,0x44,0xb3,0xf5,0x20,0x1f,0x03,0xd8,0x00,0xf0,
0x8b,0xf8,0x00,0x20,0x10,0xbd,0x4f,0xf4,0x82,0x70,0xfb,0xe7,0xf8,0xb5,0x20,0x4a,
0x20,0x49,0x21,0x48,0x20,0x4e,0xff,0xf7,0x97,0xff,0x00,0x23,0x14,0x25,0x34,0x46,
0x1e,0x4f,0x3b,0x60,0x3b,0x68,0x05,0xfb,0x03,0x63,0x03,0xf1,0x08,0x02,0x51,0x68,
0x00,0x29,0xfc,0xd0,0x12,0x68,0x02,0x2a,0x0d,0xd0,0x03,0x2a,0x11,0xd0,0x01,0x2a,
0x14,0xd1,0xff,0xf7,0x95,0xff,0x3a,0x68,0x98,0xb1,0x14,0x22,0x3b,0x68,0x02,0xfb,
0x03,0x44,0xe0,0x60,0xfe,0xe7,0x18,0x69,0x19,0x68,0x5a,0x68,0xff,0xf7,0xc6,0xff,
0xf1,0xe7,0x18,0x68,0x59,0x68,0xff,0xf7,0x95,0xff,0xec,0xe7,0x40,0xf2,0x05,0x10,
0xeb,0xe7,0x05,0xfb,0x02,0x43,0x19,0x7b,0x18,0x73,0x59,0x7b,0x58,0x73,0x99,0x7b,
0x82,0xf0,0x01,0x02,0x98,0x73,0xd9,0x7b,0x3a,0x60,0xd8,0x73,0xca,0xe7,0x00,0xbf,
0x00,0x24,0x00,0x20,0x00,0x1c,0x00,0x20,0xd8,0x1b,0x00,0x20,0x60,0x0c,0x00,0x20,
0xfe,0xe7,0x00,0x00,0x08,0xb5,0x00,0x23,0x00,0xf5,0x80,0x60,0xc0,0x02,0x1a,0x58,
0x01,0x32,0x0f,0xd1,0x04,0x33,0xb3,0xf5,0x00,0x6f,0xf8,0xd1,0x00,0x20,0x08,0xbd,
0x82,0x1c,0x04,0xd0,0x00,0x28,0xf9,0xd0,0x40,0xf2,0x03,0x10,0xf7,0xe7,0x4f,0xf4,
0x81,0x70,0xf4,0xe7,0x05,0x4b,0x4f,0xf4,0x00,0x61,0x1b,0x68,0xdb,0x68,0x98,0x47,
0x43,0x1c,0xed,0xd1,0x40,0xf2,0x01,0x10,0xe9,0xe7,0x00,0xbf,0x00,0x07,0x00,0x20,
0x10,0xb5,0x08,0x4b,0x1b,0x68,0x5b,0x68,0x98,0x47,0xc0,0x0a,0x44,0x1e,0x63,0x1c,
0x01,0xd1,0x00,0x20,0x10,0xbd,0x20,0x46,0xff,0xf7,0xcc,0xff,0x00,0x28,0xf9,0xd1,
0x01,0x3c,0xf4,0xe7,0x00,0x07,0x00,0x20,0x08,0xb5,0x0a,0x4b,0x1b,0x68,0x1b,0x69,
0x98,0x47,0x42,0x1c,0x07,0xd0,0x83,0x1c,0x08,0xd0,0x00,0x28,0x14,0xbf,0x4f,0xf4,
0x83,0x70,0x00,0x20,0x08,0xbd,0x4f,0xf4,0x82,0x70,0xfb,0xe7,0x40,0xf2,0x05,0x10,
0xf8,0xe7,0x00,0xbf,0x00,0x07,0x00,0x20,0x10,0xb5,0x01,0x00,0x00,0x23,0x00,0x22,
0x00,0x20,0x00,0xf0,0xb1,0xf8,0x10,0xbc,0x02,0xbc,0x08,0x47,0x10,0xb5,0x00,0x21,
0x04,0x00,0x00,0xf0,0xef,0xf8,0x05,0x4b,0x18,0x68,0xc3,0x6b,0x00,0x2b,0x01,0xd0,
0x00,0xf0,0x06,0xf8,0x20,0x00,0xff,0xf7,0x93,0xff,0xc0,0x46,0xf8,0x06,0x00,0x20,
0x18,0x47,0xc0,0x46,0x70,0xb5,0x0a,0x4b,0x0a,0x4c,0xe4,0x1a,0xa4,0x10,0x0a,0xd0,
0x09,0x4a,0xa5,0x18,0xad,0x00,0xed,0x18,0x2b,0x68,0x01,0x3c,0x00,0xf0,0x0e,0xf8,
0x04,0x3d,0x00,0x2c,0xf8,0xd1,0x00,0xf0,0x49,0xf9,0x70,0xbc,0x01,0xbc,0x00,0x47,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x3f,0x18,0x47,0xc0,0x46,
0x70,0xb5,0x0f,0x4e,0x0f,0x4d,0xad,0x1b,0xad,0x10,0x07,0xd0,0x00,0x24,0xa3,0x00,
0xf3,0x58,0x01,0x34,0x00,0xf0,0x1c,0xf8,0xa5,0x42,0xf8,0xd1,0x00,0xf0,0x28,0xf9,
0x09,0x4e,0x0a,0x4d,0xad,0x1b,0xad,0x10,0x07,0xd0,0x00,0x24,0xa3,0x00,0xf3,0x58,
0x01,0x34,0x00,0xf0,0x0d,0xf8,0xa5,0x42,0xf8,0xd1,0x70,0xbc,0x01,0xbc,0x00,0x47,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x47,0xc0,0x46,0xf0,0xb5,0x83,0x07,0x4a,0xd0,0x54,0x1e,0x00,0x2a,0x44,0xd0,
0x0d,0x06,0x2d,0x0e,0x02,0x00,0x03,0x26,0x02,0xe0,0x1a,0x00,0x01,0x3c,0x3c,0xd3,
0x53,0x1c,0x15,0x70,0x33,0x42,0xf8,0xd1,0x03,0x2c,0x2d,0xd9,0xff,0x22,0x0a,0x40,
0x15,0x02,0x15,0x43,0x2a,0x04,0x15,0x43,0x0f,0x2c,0x16,0xd9,0x27,0x00,0x10,0x3f,
0x3f,0x09,0x3e,0x01,0xb4,0x46,0x1e,0x00,0x1a,0x00,0x10,0x36,0x66,0x44,0x15,0x60,
0x55,0x60,0x95,0x60,0xd5,0x60,0x10,0x32,0xb2,0x42,0xf8,0xd1,0x0f,0x22,0x01,0x37,
0x3f,0x01,0xdb,0x19,0x14,0x40,0x03,0x2c,0x0e,0xd9,0x26,0x1f,0xb6,0x08,0xb7,0x00,
0xbc,0x46,0x1a,0x00,0x1f,0x1d,0x67,0x44,0x20,0xc2,0xba,0x42,0xfc,0xd1,0x03,0x22,
0x01,0x36,0xb6,0x00,0x9b,0x19,0x14,0x40,0x00,0x2c,0x06,0xd0,0x09,0x06,0x1c,0x19,
0x09,0x0e,0x19,0x70,0x01,0x33,0x9c,0x42,0xfb,0xd1,0xf0,0xbc,0x02,0xbc,0x08,0x47,
0x14,0x00,0x03,0x00,0xc0,0xe7,0xc0,0x46,0xf0,0xb5,0xc6,0x46,0x00,0xb5,0x20,0x4c,
0x24,0x68,0x82,0xb0,0x01,0x94,0xa4,0x24,0x01,0x9d,0x64,0x00,0x2d,0x59,0x00,0x2d,
0x2d,0xd0,0x6c,0x68,0x1f,0x2c,0x30,0xdc,0x00,0x28,0x0b,0xd1,0x00,0x20,0x63,0x1c,
0x02,0x34,0xa4,0x00,0x6b,0x60,0x61,0x51,0x02,0xb0,0x04,0xbc,0x90,0x46,0xf0,0xbc,
0x02,0xbc,0x08,0x47,0x88,0x27,0xa6,0x00,0xae,0x19,0xf2,0x51,0x01,0x37,0xff,0x37,
0xbc,0x46,0x01,0x22,0xac,0x44,0x67,0x46,0xa2,0x40,0x3f,0x68,0x90,0x46,0x17,0x43,
0x62,0x46,0x17,0x60,0x84,0x27,0x7f,0x00,0xf3,0x51,0x02,0x28,0xde,0xd1,0x2b,0x00,
0x40,0x46,0x8d,0x33,0xff,0x33,0x1a,0x68,0x10,0x43,0x18,0x60,0xd6,0xe7,0x01,0x9d,
0x01,0x9e,0x4d,0x35,0xff,0x35,0x35,0x51,0xcb,0xe7,0x01,0x20,0x40,0x42,0xd3,0xe7,
0xf8,0x06,0x00,0x20,0xf0,0xb5,0x4e,0x46,0xde,0x46,0x57,0x46,0x45,0x46,0xe0,0xb5,
0x2e,0x4b,0x1b,0x68,0x83,0xb0,0x1a,0x00,0x00,0x93,0xa4,0x23,0x5b,0x00,0xd6,0x58,
0x01,0x22,0x01,0x90,0x0f,0x00,0x93,0x46,0x99,0x46,0x00,0x2e,0x31,0xd0,0x74,0x68,
0x65,0x1e,0x2e,0xd4,0xc4,0x23,0x5b,0x00,0x9a,0x46,0x01,0x34,0xa4,0x00,0x34,0x19,
0xb2,0x44,0x02,0xe0,0x04,0x3c,0x01,0x3d,0x23,0xd3,0x00,0x2f,0x04,0xd0,0x63,0x1c,
0xff,0x33,0x1b,0x68,0xbb,0x42,0xf5,0xd1,0x73,0x68,0x01,0x3b,0x22,0x68,0xab,0x42,
0x20,0xd0,0x00,0x23,0x23,0x60,0x00,0x2a,0xec,0xd0,0x73,0x68,0x98,0x46,0x5b,0x46,
0x51,0x46,0xab,0x40,0x09,0x68,0x19,0x42,0x16,0xd1,0x00,0xf0,0x29,0xf8,0x4a,0x46,
0x00,0x9b,0x9b,0x58,0x72,0x68,0x42,0x45,0x01,0xd1,0x9e,0x42,0xda,0xd0,0x1e,0x1e,
0xcd,0xd1,0x03,0xb0,0x3c,0xbc,0x90,0x46,0x99,0x46,0xa2,0x46,0xab,0x46,0xf0,0xbc,
0x01,0xbc,0x00,0x47,0x75,0x60,0xde,0xe7,0x30,0x00,0x21,0x00,0x8d,0x30,0xff,0x30,
0x00,0x68,0x80,0x31,0x09,0x68,0x18,0x42,0x03,0xd1,0x01,0x98,0x00,0xf0,0x08,0xf8,
0xdd,0xe7,0x08,0x00,0x00,0xf0,0x04,0xf8,0xd9,0xe7,0xc0,0x46,0xf8,0x06,0x00,0x20,
0x10,0x47,0xc0,0x46,0x04,0x4b,0x10,0xb5,0x00,0x2b,0x02,0xd0,0x03,0x48,0xff,0xf7,
0x93,0xfe,0x10,0xbc,0x01,0xbc,0x00,0x47,0x00,0x00,0x00,0x00,0x25,0x04,0x00,0x20,
0xf8,0xb5,0xc0,0x46,0xf8,0xbc,0x08,0xbc,0x9e,0x46,0x70,0x47,0xf8,0xb5,0xc0,0x46,
0xf8,0xbc,0x08,0xbc,0x9e,0x46,0x70,0x47,0x00,0x00,0x00,0x00,0x08,0xfa,0xff,0x7f,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x07,0x00,0x20,0x00,0x00,0x00,0x00,
0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x07,0x00,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xfc,0x09,0x00,0x20,0x64,0x0a,0x00,0x20,0xcc,0x0a,0x00,0x20,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0e,0x33,0xcd,0xab,0x34,0x12,0x6d,0xe6,0xec,0xde,0x05,0x00,0x0b,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x20,0x99,0x00,0x00,0x20,
0xb5,0x06,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+ 109
- 0
contrib/loaders/flash/cc2538/flash.c View File

@@ -0,0 +1,109 @@
/******************************************************************************
*
* Copyright (C) 2020 Loci Controls Inc
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#include <stdint.h>
#include <stdbool.h>
#include "flash.h"

struct rom_api {
unsigned long (*Crc32)(unsigned char *pucData,
unsigned long ulByteCount);
unsigned long (*GetFlashSize)(void);
unsigned long (*GetChipId)(void);
long (*PageErase)(unsigned long ulStartAddress,
unsigned long ulEraseSize);
long (*ProgramFlash)(unsigned long *pulData,
unsigned long ulAddress,
unsigned long ulCount);
} *ROM = (struct rom_api *)0x00000048;

extern uint32_t flash_sector_erase(uint32_t sector)
{
long ret;
bool already_erased = true;
int i;

uint32_t address = flash_sector_to_address(sector);

for (i = 0; i < FLASH_ERASE_SIZE; i += 4) {
if ((*(uint32_t *)(address + i)) != 0xffffffff) {
already_erased = false;
break;
}
}
if (already_erased)
return 0;

ret = ROM->PageErase(address, FLASH_ERASE_SIZE);
if (ret == -1)
return 0x101;
if (ret == -2)
return 0x102;
if (ret != 0)
return 0x103;
return 0;
}

extern uint32_t flash_bank_erase(void)
{
int i;
long ret;
/* Some pages may be locked by bits in the CCA. Erasing the CCA
first will ensure that those pages will become unlocked.
So, since the CCA is the last page in flash, let's just erase
sectors backwards. */
int num_sectors = ROM->GetFlashSize() / FLASH_ERASE_SIZE;
for (i = num_sectors - 1; i >= 0; i--)
{
ret = flash_sector_erase(i);
if (ret != 0)
return ret;
}
return 0;
}

extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,
uint32_t count)
{
long ret;
ret = ROM->ProgramFlash((unsigned long *)data_buffer, address, count);
if (ret == -1)
return 0x104;
if (ret == -2)
return 0x105;
if (ret != 0)
return 0x106;
return 0;
}

+ 61
- 0
contrib/loaders/flash/cc2538/flash.h View File

@@ -0,0 +1,61 @@
/******************************************************************************
*
* Copyright (C) 2020 Loci Controls Inc
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASH_H
#define OPENOCD_LOADERS_FLASH_CC2538_FLASH_H

#include <stdint.h>
#include <stdbool.h>

/* Location of flash in memory map */
#define FLASHMEM_BASE 0x00200000

#define FLASH_ERASE_SIZE 2048
#define FLASH_MAX_SECTOR_COUNT 256
#define FLASH_MAX_BYTES (FLASH_ERASE_SIZE * FLASH_MAX_SECTOR_COUNT)

extern uint32_t flash_sector_erase(uint32_t sector);
extern uint32_t flash_bank_erase(void);
extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,
uint32_t count);

static inline uint32_t flash_address_to_sector(uint32_t address) {
return ((address - FLASHMEM_BASE) / FLASH_ERASE_SIZE);
};
static inline uint32_t flash_sector_to_address(uint32_t sector) {
return (FLASHMEM_BASE + (sector * FLASH_ERASE_SIZE));
};

#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASH_H */

+ 117
- 0
contrib/loaders/flash/cc2538/flashloader.c View File

@@ -0,0 +1,117 @@
/******************************************************************************
*
* Copyright (C) 2020 Loci Controls Inc
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#include <stdint.h>
#include <stdbool.h>
#include "flashloader.h"
#include "flash.h"

/* Array holding erased state of the flash sectors. */
static bool g_is_erased[FLASH_MAX_SECTOR_COUNT];

extern uint8_t g_retain_buf[];

uint32_t flashloader_init(struct flash_params *params, uint8_t *buf1,
uint8_t *buf2)
{
/* Initialize params buffers */
memset((void *)params, 0, 2 * sizeof(struct flash_params));
params[0].buf_addr = (uint32_t)buf1;
params[1].buf_addr = (uint32_t)buf2;

/* Mark all sectors at "not erased" */
memset(g_is_erased, false, sizeof(g_is_erased));

return STATUS_OK;
}

uint32_t flashloader_erase_all(void)
{
if (flash_bank_erase() != 0)
return STATUS_FAILED_ERASE_ALL;

memset(g_is_erased, true, sizeof(g_is_erased));

return STATUS_OK;
}

uint32_t flashloader_erase_sectors(uint32_t address, uint32_t byte_count)
{
uint32_t first_sector_idx;
uint32_t last_sector_idx;
uint32_t status;
uint32_t idx;

if (address < FLASHMEM_BASE ||
(address + byte_count) > (FLASHMEM_BASE + FLASH_MAX_BYTES))
return STATUS_FAILED_INVALID_ARGUMENTS;

/* Convert address and count to range of sectors */
first_sector_idx = flash_address_to_sector(address);
last_sector_idx = flash_address_to_sector(address + byte_count - 1);

/* Erase given sector(s) */
for (idx = first_sector_idx; idx <= last_sector_idx; idx++) {

/* Only erase sectors that haven't already been erased */
if (g_is_erased[idx] == false) {
status = flash_sector_erase(idx);
if (status != 0) {
status = (STATUS_FAILED_SECTOR_ERASE |
((idx << STATUS_EXT_INFO_S) & STATUS_EXT_INFO_M) |
((status << STATUS_ROM_CODE_S) & STATUS_ROM_CODE_M));
return status;
}
g_is_erased[idx] = true;
}
}

return STATUS_OK;
}

uint32_t flashloader_program(uint8_t *src, uint32_t address, uint32_t byte_count)
{
if (address < FLASHMEM_BASE ||
(address + byte_count) > (FLASHMEM_BASE + FLASH_MAX_BYTES))
return STATUS_FAILED_INVALID_ARGUMENTS;

uint32_t status = flash_program(src, address, byte_count);
if (status != 0) {
status = (STATUS_FAILED_PROGRAM |
((status << STATUS_ROM_CODE_S) & STATUS_ROM_CODE_M));
}

return STATUS_OK;
}

+ 143
- 0
contrib/loaders/flash/cc2538/flashloader.h View File

@@ -0,0 +1,143 @@
/******************************************************************************
*
* Copyright (C) 2020 Loci Controls Inc
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASHLOADER_H
#define OPENOCD_LOADERS_FLASH_CC2538_FLASHLOADER_H

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "flash.h"

/* Number of elements in an array */
#define NELEMS(a) (sizeof(a) / sizeof(a[0]))

struct __attribute__((__packed__)) flash_params {
uint32_t dest; /* Destination address in flash */
uint32_t len; /* Number of bytes */
uint32_t cmd; /* Command */
uint32_t full; /* Handshake signal. Is buffer ready? */
uint32_t buf_addr; /* Address of data buffer. */
};

typedef enum {
CMD_NO_ACTION = 0, /* No action, default value */
CMD_ERASE_ALL = 1, /* Erase all unprotected sectors */
CMD_PROGRAM = 2, /* Program data */
CMD_ERASE_SECTORS = 3 /* Erase unprotected sectors */
} flash_commands_t;

typedef enum {
BUFFER_EMPTY = 0x0, /* No data in buffer, flags last task complete */
BUFFER_FULL = 0xFFFFFFFF /* Buffer has data, flags next task to start */
} flash_handshake_t;

#define STATUS_FLASHLOADER_STATUS_M 0x0000FFFF
#define STATUS_FLASHLOADER_STATUS_S 0
#define STATUS_ROM_CODE_M 0x00FF0000
#define STATUS_ROM_CODE_S 16
#define STATUS_EXT_INFO_M 0xFF000000
#define STATUS_EXT_INFO_S 24

typedef enum {
STATUS_OK = 0,
STATUS_FAILED_ERASE_ALL = 0x101,
STATUS_FAILED_SECTOR_ERASE = 0x102,
STATUS_FAILED_PROGRAM = 0x103,
STATUS_FAILED_INVALID_ARGUMENTS = 0x104,
STATUS_FAILED_UNKNOWN_COMMAND = 0x105,
} flash_status_t;

/* The buffer size used by the flashloader. The size of 1 flash sector. */
#define BUFFER_LEN FLASH_ERASE_SIZE

/*
* This function initializes the flashloader. The application must
* allocate memory for the two data buffers and the flash_params structures.
*
* params Pointer an flash_params array with 2 elements.
* buf1 Pointer to data buffer 1
* buf2 Pointer to data buffer 2
*
* Returns STATUS_OK
*
*/
extern uint32_t flashloader_init(struct flash_params *params, uint8_t *buf1,
uint8_t *buf2);

/*
* Erases all flash sectors (that are not write-protected).
*
* Returns STATUS_OK on success.
*
*/
extern uint32_t flashloader_erase_all(void);

/*
* Erases the flash sectors affected by the given range.
*
* This function only erases sectors that are not already erased.
*
* start_addr The first address in the range.
* byte_count The number of bytes in the range.
*
* Returns STATUS_OK on success. Returns a combined status on failure:
* [31:24] The sector that failed.
* [23:16] ROM function status code. 0 means success.
* [16: 0] STATUS_FAILED_SECTOR_ERASE
*
*/
extern uint32_t flashloader_erase_sectors(uint32_t start_address,
uint32_t byte_count);

/*
* Program the given range.
*
* This function does not erase anything, it assumes the sectors are ready to
* be programmed.
*
* src Pointer to buffer containing the data.
* address Start address in device flash
* byte_count The number of bytes to program
*
* Returns STATUS_OK on success. Returns a combined status value on failure:
* [31:16] ROM function status code. 0 means success.
* [15:0 ] STATUS_FAILED_PROGRAM
*
*/
extern uint32_t flashloader_program(uint8_t *src, uint32_t address,
uint32_t byte_count);

#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC2538_FLASHLOADER_H */

+ 116
- 0
contrib/loaders/flash/cc2538/main.c View File

@@ -0,0 +1,116 @@
/******************************************************************************
*
* Copyright (C) 2020 Loci Controls Inc
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/

#include <stdint.h>
#include <stdbool.h>
#include "flashloader.h"

/* Data buffers used by host to communicate with flashloader */

/* Flashloader parameter structure. */
__attribute__ ((section(".buffers.g_cfg")))
volatile struct flash_params g_cfg[2];
/* Data buffer 1. */
__attribute__ ((section(".buffers.g_buf1")))
uint8_t g_buf1[BUFFER_LEN];
/* Data buffer 2. */
__attribute__ ((section(".buffers.g_buf2")))
uint8_t g_buf2[BUFFER_LEN];

/* Buffer used for program with retain feature */
__attribute__ ((section(".buffers.g_retain_buf")))
uint8_t g_retain_buf[BUFFER_LEN];

uint32_t g_curr_buf; /* Current buffer used. */
uint32_t g_vims_ctl; /* Saved flash cache state. */

/******************************************************************************
*
* CC2538 flashloader main function.
*
******************************************************************************/
int main(void)
{
flashloader_init((struct flash_params *)g_cfg, g_buf1, g_buf2);

g_curr_buf = 0; /* start with the first buffer */
uint32_t status;

while (1) {
/* Wait for host to signal buffer is ready */
while (g_cfg[g_curr_buf].full == BUFFER_EMPTY)
;

/* Perform requested task */
switch (g_cfg[g_curr_buf].cmd) {
case CMD_ERASE_ALL:
status = flashloader_erase_all();
break;
case CMD_PROGRAM:
status =
flashloader_program(
(uint8_t *)g_cfg[g_curr_buf].buf_addr,
g_cfg[g_curr_buf].dest, g_cfg[g_curr_buf].len);
break;
case CMD_ERASE_SECTORS:
status =
flashloader_erase_sectors(g_cfg[g_curr_buf].dest,
g_cfg[g_curr_buf].len);
break;
default:
status = STATUS_FAILED_UNKNOWN_COMMAND;
break;
}

/* Enter infinite loop on error condition */
if (status != STATUS_OK) {
g_cfg[g_curr_buf].full = status;
while (1)
;
}

/* Mark current task complete, and begin looking at next buffer */
g_cfg[g_curr_buf].full = BUFFER_EMPTY;
g_curr_buf ^= 1;
}
}

void _exit(int status)
{
/* Enter infinite loop on hitting an exit condition */
(void)status; /* Unused parameter */
while (1)
;
}

+ 37
- 0
contrib/loaders/flash/cc2538/startup.s View File

@@ -0,0 +1,37 @@
.section .entry
.global entry
.syntax unified
.thumb_func
entry:
/* Disable interrupts */
cpsid i

/* Privileged mode, main stack, no floating point */
mov r0, #0
msr control, r0
isb

/* Load initial stack pointer */
ldr r0, =_estack
mov sp, r0
isb

/* Clear BSS */
mov r0, #0
ldr r1, =_bss
ldr r2, =_ebss
1:
cmp r1, r2
it lt
strlt r0, [r1], #4
blt 1b

/* No need to copy initialized data, since it's already in RAM */

/* It's safe to call C code now */
bl __libc_init_array
bl main

/* Main returned -- hang */
b .


+ 3
- 1
src/Makefile.am View File

@@ -53,7 +53,8 @@ endif
%D%/target/libtarget.la \
%D%/server/libserver.la \
%D%/rtos/librtos.la \
%D%/helper/libhelper.la
%D%/helper/libhelper.la \
%D%/rtt/librtt.la

BIN2C = $(srcdir)/%D%/helper/bin2char.sh

@@ -83,3 +84,4 @@ include %D%/rtos/Makefile.am
include %D%/server/Makefile.am
include %D%/flash/Makefile.am
include %D%/pld/Makefile.am
include %D%/rtt/Makefile.am

+ 2
- 0
src/flash/nor/Makefile.am View File

@@ -21,6 +21,7 @@ NOR_DRIVERS = \
%D%/avrf.c \
%D%/bluenrg-x.c \
%D%/cc3220sf.c \
%D%/cc2538.c \
%D%/cc26xx.c \
%D%/cfi.c \
%D%/dsp5680xx_flash.c \
@@ -76,6 +77,7 @@ NOR_DRIVERS = \
NORHEADERS = \
%D%/core.h \
%D%/cc3220sf.h \
%D%/cc2538.h \
%D%/cc26xx.h \
%D%/cfi.h \
%D%/driver.h \


+ 435
- 0
src/flash/nor/cc2538.c View File

@@ -0,0 +1,435 @@
/***************************************************************************
* Copyright (C) 2020 Loci Controls Inc *
* Copyright (C) 2017 by Texas Instruments, Inc. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "imp.h"
#include "cc2538.h"
#include <helper/binarybuffer.h>
#include <helper/time_support.h>
#include <target/algorithm.h>
#include <target/armv7m.h>
#include <target/image.h>

#define FLASH_TIMEOUT 10000

struct cc2538_bank {
const char *family_name;
uint16_t chip_id;
bool probed;
struct working_area *working_area;
struct armv7m_algorithm armv7m_info;
const uint8_t *algo_code;
uint32_t algo_size;
uint32_t algo_working_size;
uint32_t buffer_addr[2];
uint32_t params_addr[2];
};

static int cc2538_auto_probe(struct flash_bank *bank);

static int cc2538_wait_algo_done(struct flash_bank *bank, uint32_t params_addr)
{
struct target *target = bank->target;

uint32_t status_addr = params_addr + CC2538_STATUS_OFFSET;
uint32_t status = CC2538_BUFFER_FULL;
long long start_ms;
long long elapsed_ms;

int retval = ERROR_OK;

start_ms = timeval_ms();
while (CC2538_BUFFER_FULL == status) {
retval = target_read_u32(target, status_addr, &status);
if (ERROR_OK != retval)
return retval;

elapsed_ms = timeval_ms() - start_ms;
if (elapsed_ms > 500)
keep_alive();
if (elapsed_ms > FLASH_TIMEOUT)
break;
};

if (CC2538_BUFFER_EMPTY != status) {
LOG_ERROR("cc2538: Flash operation failed (0x%08x)", status);
return ERROR_FAIL;
}

return ERROR_OK;
}

static int cc2538_init(struct flash_bank *bank)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;

int retval;

/* Make sure we've probed the flash to get the size */
retval = cc2538_auto_probe(bank);
if (ERROR_OK != retval)
return retval;

/* Check for working area to use for flash helper algorithm */
if (NULL != cc2538_bank->working_area)
target_free_working_area(target, cc2538_bank->working_area);
retval = target_alloc_working_area(target, cc2538_bank->algo_working_size,
&cc2538_bank->working_area);
if (ERROR_OK != retval)
return retval;

/* Confirm the defined working address is the area we need to use */
if (CC2538_ALGO_BASE_ADDRESS != cc2538_bank->working_area->address)
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;

/* Write flash helper algorithm into target memory */
retval = target_write_buffer(target, CC2538_ALGO_BASE_ADDRESS,
cc2538_bank->algo_size, cc2538_bank->algo_code);
if (ERROR_OK != retval) {
LOG_ERROR("cc2538: Failed to load flash helper algorithm");
target_free_working_area(target, cc2538_bank->working_area);
return retval;
}

/* Initialize the ARMv7 specific info to run the algorithm */
cc2538_bank->armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
cc2538_bank->armv7m_info.core_mode = ARM_MODE_THREAD;

/* Begin executing the flash helper algorithm */
retval = target_start_algorithm(target, 0, NULL, 0, NULL,
CC2538_ALGO_BASE_ADDRESS, 0, &cc2538_bank->armv7m_info);
if (ERROR_OK != retval) {
LOG_ERROR("cc2538: Failed to start flash helper algorithm");
target_free_working_area(target, cc2538_bank->working_area);
return retval;
}

/*
* At this point, the algorithm is running on the target and
* ready to receive commands and data to flash the target
*/

return retval;
}

static int cc2538_quit(struct flash_bank *bank)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;

int retval;

/* Regardless of the algo's status, attempt to halt the target */
(void)target_halt(target);

/* Now confirm target halted and clean up from flash helper algorithm */
retval = target_wait_algorithm(target, 0, NULL, 0, NULL, 0, FLASH_TIMEOUT,
&cc2538_bank->armv7m_info);

target_free_working_area(target, cc2538_bank->working_area);
cc2538_bank->working_area = NULL;

return retval;
}

static int cc2538_mass_erase(struct flash_bank *bank)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;
struct cc2538_algo_params algo_params;

int retval;

if (TARGET_HALTED != target->state) {
LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}

retval = cc2538_init(bank);
if (ERROR_OK != retval)
return retval;

/* Initialize algorithm parameters */
buf_set_u32(algo_params.address, 0, 32, 0);
buf_set_u32(algo_params.length, 0, 32, 4);
buf_set_u32(algo_params.command, 0, 32, CC2538_CMD_ERASE_ALL);
buf_set_u32(algo_params.status, 0, 32, CC2538_BUFFER_FULL);

/* Issue flash helper algorithm parameters for mass erase */
retval = target_write_buffer(target, cc2538_bank->params_addr[0],
sizeof(algo_params), (uint8_t *)&algo_params);

/* Wait for command to complete */
if (ERROR_OK == retval)
retval = cc2538_wait_algo_done(bank, cc2538_bank->params_addr[0]);

/* Regardless of errors, try to close down algo */
(void)cc2538_quit(bank);

return retval;
}

FLASH_BANK_COMMAND_HANDLER(cc2538_flash_bank_command)
{
struct cc2538_bank *cc2538_bank;

if (CMD_ARGC < 6)
return ERROR_COMMAND_SYNTAX_ERROR;

cc2538_bank = malloc(sizeof(struct cc2538_bank));
if (NULL == cc2538_bank)
return ERROR_FAIL;

/* Initialize private flash information */
memset((void *)cc2538_bank, 0x00, sizeof(struct cc2538_bank));

/* Finish initialization of bank */
bank->driver_priv = cc2538_bank;
bank->next = NULL;

return ERROR_OK;
}

static int cc2538_erase(struct flash_bank *bank, int first, int last)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;
struct cc2538_algo_params algo_params;

uint32_t address;
uint32_t length;
int retval;

if (TARGET_HALTED != target->state) {
LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}

/* Do a mass erase if user requested all sectors of flash */
if ((first == 0) && (last == (bank->num_sectors - 1))) {
/* Request mass erase of flash */
return cc2538_mass_erase(bank);
}

address = bank->base + first * CC2538_SECTOR_LENGTH;
length = (last - first + 1) * CC2538_SECTOR_LENGTH;

retval = cc2538_init(bank);
if (ERROR_OK != retval)
return retval;

/* Set up algorithm parameters for erase command */
buf_set_u32(algo_params.address, 0, 32, address);
buf_set_u32(algo_params.length, 0, 32, length);
buf_set_u32(algo_params.command, 0, 32, CC2538_CMD_ERASE_SECTORS);
buf_set_u32(algo_params.status, 0, 32, CC2538_BUFFER_FULL);

/* Issue flash helper algorithm parameters for erase */
retval = target_write_buffer(target, cc2538_bank->params_addr[0],
sizeof(algo_params), (uint8_t *)&algo_params);

/* If no error, wait for erase to finish */
if (ERROR_OK == retval)
retval = cc2538_wait_algo_done(bank, cc2538_bank->params_addr[0]);

/* Regardless of errors, try to close down algo */
(void)cc2538_quit(bank);

return retval;
}

static int cc2538_write(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;
struct cc2538_algo_params algo_params[2];
uint32_t size = 0;
long long start_ms;
long long elapsed_ms;
uint32_t address;

uint32_t index;
int retval;

if (TARGET_HALTED != target->state) {
LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}

retval = cc2538_init(bank);
if (ERROR_OK != retval)
return retval;

/* Initialize algorithm parameters to default values */
buf_set_u32(algo_params[0].command, 0, 32, CC2538_CMD_PROGRAM);
buf_set_u32(algo_params[1].command, 0, 32, CC2538_CMD_PROGRAM);

/* Write requested data, ping-ponging between two buffers */
index = 0;
start_ms = timeval_ms();
address = bank->base + offset;
while (count > 0) {

if (count > CC2538_SECTOR_LENGTH)
size = CC2538_SECTOR_LENGTH;
else
size = count;

/* Put next block of data to flash into buffer */
retval = target_write_buffer(target, cc2538_bank->buffer_addr[index],
size, buffer);
if (ERROR_OK != retval) {
LOG_ERROR("Unable to write data to target memory");
break;
}

/* Update algo parameters for next block */
buf_set_u32(algo_params[index].address, 0, 32, address);
buf_set_u32(algo_params[index].length, 0, 32, size);
buf_set_u32(algo_params[index].status, 0, 32, CC2538_BUFFER_FULL);

/* Issue flash helper algorithm parameters for block write */
retval = target_write_buffer(target, cc2538_bank->params_addr[index],
sizeof(algo_params[index]), (uint8_t *)&algo_params[index]);
if (ERROR_OK != retval)
break;

/* Wait for next ping pong buffer to be ready */
index ^= 1;
retval = cc2538_wait_algo_done(bank, cc2538_bank->params_addr[index]);
if (ERROR_OK != retval)
break;

count -= size;
buffer += size;
address += size;

elapsed_ms = timeval_ms() - start_ms;
if (elapsed_ms > 500)
keep_alive();
}

/* If no error yet, wait for last buffer to finish */
if (ERROR_OK == retval) {
index ^= 1;
retval = cc2538_wait_algo_done(bank, cc2538_bank->params_addr[index]);
}

/* Regardless of errors, try to close down algo */
(void)cc2538_quit(bank);

return retval;
}

static int cc2538_probe(struct flash_bank *bank)
{
struct target *target = bank->target;
struct cc2538_bank *cc2538_bank = bank->driver_priv;

uint32_t value;
int num_sectors;

int retval;

retval = target_read_u32(target, CC2538_FLASH_CTRL_DIECFG0, &value);
if (ERROR_OK != retval)
return retval;

cc2538_bank->chip_id = value >> 16;

num_sectors = ((value & 0x70) >> 4) * 0x20000 / CC2538_SECTOR_LENGTH;
if (num_sectors > CC2538_MAX_SECTORS)
num_sectors = CC2538_MAX_SECTORS;

bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
if (NULL == bank->sectors)
return ERROR_FAIL;

/* Set up flash helper algorithm */
cc2538_bank->algo_code = cc2538_algo;
cc2538_bank->algo_size = sizeof(cc2538_algo);
cc2538_bank->algo_working_size = CC2538_WORKING_SIZE;
cc2538_bank->buffer_addr[0] = CC2538_ALGO_BUFFER_0;
cc2538_bank->buffer_addr[1] = CC2538_ALGO_BUFFER_1;
cc2538_bank->params_addr[0] = CC2538_ALGO_PARAMS_0;
cc2538_bank->params_addr[1] = CC2538_ALGO_PARAMS_1;

bank->base = CC2538_FLASH_BASE_ADDR;
bank->num_sectors = num_sectors;
bank->size = num_sectors * CC2538_SECTOR_LENGTH;
bank->write_start_alignment = 0;
bank->write_end_alignment = 0;

for (int i = 0; i < num_sectors; i++) {
bank->sectors[i].offset = i * CC2538_SECTOR_LENGTH;
bank->sectors[i].size = CC2538_SECTOR_LENGTH;
bank->sectors[i].is_erased = -1;
bank->sectors[i].is_protected = 0;
}

/* We've successfully determined the stats on the flash bank */
cc2538_bank->probed = true;

/* If we fall through to here, then all went well */

return ERROR_OK;
}

static int cc2538_auto_probe(struct flash_bank *bank)
{
struct cc2538_bank *cc2538_bank = bank->driver_priv;

int retval = ERROR_OK;

if (!cc2538_bank->probed)
retval = cc2538_probe(bank);

return retval;
}

static int cc2538_info(struct flash_bank *bank, char *buf, int buf_size)
{
struct cc2538_bank *cc2538_bank = bank->driver_priv;
int printed = 0;

printed = snprintf(buf, buf_size,
"cc2538 device: chip ID 0x%04x\n", cc2538_bank->chip_id);

if (printed >= buf_size)
return ERROR_BUF_TOO_SMALL;

return ERROR_OK;
}

const struct flash_driver cc2538_flash = {
.name = "cc2538",
.flash_bank_command = cc2538_flash_bank_command,
.erase = cc2538_erase,
.write = cc2538_write,
.read = default_flash_read,
.probe = cc2538_probe,
.auto_probe = cc2538_auto_probe,
.erase_check = default_flash_blank_check,
.info = cc2538_info,
.free_driver_priv = default_flash_free_driver_priv,
};

+ 62
- 0
src/flash/nor/cc2538.h View File

@@ -0,0 +1,62 @@
/***************************************************************************
* Copyright (C) 2020 Loci Controls Inc *
* Copyright (C) 2017 by Texas Instruments, Inc. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifndef OPENOCD_FLASH_NOR_CC2538_H
#define OPENOCD_FLASH_NOR_CC2538_H

#define CC2538_FLASH_BASE_ADDR 0x00200000
#define CC2538_FLASH_MAX_SIZE 0x00080000
#define CC2538_ALGO_BASE_ADDRESS 0x20000000

#define CC2538_FLASH_CTRL_DIECFG0 0x400D3014

/* Flash algorithm parameters */
#define CC2538_MAX_SECTORS 256
#define CC2538_SECTOR_LENGTH 0x800
#define CC2538_ALGO_BUFFER_0 0x20001c00
#define CC2538_ALGO_BUFFER_1 0x20002400
#define CC2538_ALGO_PARAMS_0 0x20001bd8
#define CC2538_ALGO_PARAMS_1 0x20001bec
#define CC2538_WORKING_SIZE (CC2538_ALGO_BUFFER_1 + CC2538_SECTOR_LENGTH - \
CC2538_ALGO_BASE_ADDRESS)
/* Flash helper algorithm buffer flags */
#define CC2538_BUFFER_EMPTY 0x00000000
#define CC2538_BUFFER_FULL 0xffffffff

/* Flash helper algorithm commands */
#define CC2538_CMD_NO_ACTION 0
#define CC2538_CMD_ERASE_ALL 1
#define CC2538_CMD_PROGRAM 2
#define CC2538_CMD_ERASE_SECTORS 3

/* Flash helper algorithm parameter block struct */
#define CC2538_STATUS_OFFSET 0x0c
struct cc2538_algo_params {
uint8_t address[4];
uint8_t length[4];
uint8_t command[4];
uint8_t status[4];
};

/* Flash helper algorithm */
const uint8_t cc2538_algo[] = {
#include "../../../contrib/loaders/flash/cc2538/cc2538_algo.inc"
};


#endif /* OPENOCD_FLASH_NOR_CC2538_H */

+ 2
- 0
src/flash/nor/drivers.c View File

@@ -34,6 +34,7 @@ extern const struct flash_driver atsamv_flash;
extern const struct flash_driver avr_flash;
extern const struct flash_driver bluenrgx_flash;
extern const struct flash_driver cc3220sf_flash;
extern const struct flash_driver cc2538_flash;
extern const struct flash_driver cc26xx_flash;
extern const struct flash_driver cfi_flash;
extern const struct flash_driver dsp5680xx_flash;
@@ -106,6 +107,7 @@ static const struct flash_driver * const flash_drivers[] = {
&avr_flash,
&bluenrgx_flash,
&cc3220sf_flash,
&cc2538_flash,
&cc26xx_flash,
&cfi_flash,
&dsp5680xx_flash,


+ 9
- 0
src/openocd.c View File

@@ -38,9 +38,11 @@
#include <pld/pld.h>
#include <target/arm_cti.h>
#include <target/arm_adi_v5.h>
#include <rtt/rtt.h>

#include <server/server.h>
#include <server/gdb_server.h>
#include <server/rtt_server.h>

#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -247,6 +249,8 @@ struct command_context *setup_command_handler(Jim_Interp *interp)
&server_register_commands,
&gdb_register_commands,
&log_register_commands,
&rtt_register_commands,
&rtt_server_register_commands,
&transport_register_commands,
&interface_register_commands,
&target_register_commands,
@@ -338,6 +342,9 @@ int openocd_main(int argc, char *argv[])
if (ioutil_init(cmd_ctx) != ERROR_OK)
return EXIT_FAILURE;

if (rtt_init() != ERROR_OK)
return EXIT_FAILURE;

LOG_OUTPUT("For bug reports, read\n\t"
"http://openocd.org/doc/doxygen/bugs.html"
"\n");
@@ -360,6 +367,8 @@ int openocd_main(int argc, char *argv[])

adapter_quit();

rtt_exit();

/* Shutdown commandline interface */
command_exit(cmd_ctx);



+ 4
- 1
src/rtos/Makefile.am View File

@@ -7,6 +7,7 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/rtos_embkernel_stackings.c \
%D%/rtos_mqx_stackings.c \
%D%/rtos_ucos_iii_stackings.c \
%D%/rtos_riot_stackings.c \
%D%/FreeRTOS.c \
%D%/ThreadX.c \
%D%/eCos.c \
@@ -18,6 +19,7 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/uCOS-III.c \
%D%/nuttx.c \
%D%/hwthread.c \
%D%/riot.c \
%D%/rtos.h \
%D%/rtos_standard_stackings.h \
%D%/rtos_ecos_stackings.h \
@@ -26,7 +28,8 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/rtos_embkernel_stackings.h \
%D%/rtos_mqx_stackings.h \
%D%/rtos_ucos_iii_stackings.h \
%D%/nuttx_header.h
%D%/nuttx_header.h \
%D%/rtos_riot_stackings.h

%C%_librtos_la_CFLAGS = $(AM_CFLAGS)



+ 414
- 0
src/rtos/riot.c View File

@@ -0,0 +1,414 @@
/***************************************************************************
* Copyright (C) 2015 by Daniel Krebs *
* Daniel Krebs - github@daniel-krebs.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <helper/time_support.h>
#include <jtag/jtag.h>
#include "target/target.h"
#include "target/target_type.h"
#include "rtos.h"
#include "helper/log.h"
#include "helper/types.h"
#include "target/armv7m.h"
#include "rtos_riot_stackings.h"

static bool riot_detect_rtos(struct target *target);
static int riot_create(struct target *target);
static int riot_update_threads(struct rtos *rtos);
static int riot_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
static int riot_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);

struct riot_thread_state {
int value;
const char *desc;
};

/* refer tcb.h */
static const struct riot_thread_state riot_thread_states[] = {
{ 0, "Stopped" },
{ 1, "Sleeping" },
{ 2, "Blocked mutex" },
{ 3, "Blocked receive" },
{ 4, "Blocked send" },
{ 5, "Blocked reply" },
{ 6, "Blocked any flag" },
{ 7, "Blocked all flags" },
{ 8, "Blocked mbox" },
{ 9, "Blocked condition" },
{ 10, "Running" },
{ 11, "Pending" },
};
#define RIOT_NUM_STATES ARRAY_SIZE(riot_thread_states)

struct riot_params {
const char *target_name;
unsigned char thread_sp_offset;
unsigned char thread_status_offset;
};

static const struct riot_params riot_params_list[] = {
{
"cortex_m", /* target_name */
0x00, /* thread_sp_offset */
0x04, /* thread_status_offset */
},
{ /* STLink */
"hla_target", /* target_name */
0x00, /* thread_sp_offset */
0x04, /* thread_status_offset */
}
};
#define RIOT_NUM_PARAMS ARRAY_SIZE(riot_params_list)

/* Initialize in riot_create() depending on architecture */
static const struct rtos_register_stacking *stacking_info;

enum riot_symbol_values {
RIOT_THREADS_BASE = 0,
RIOT_NUM_THREADS,
RIOT_ACTIVE_PID,
RIOT_MAX_THREADS,
RIOT_NAME_OFFSET,
};

/* refer core/sched.c */
static const char *const riot_symbol_list[] = {
"sched_threads",
"sched_num_threads",
"sched_active_pid",
"max_threads",
"_tcb_name_offset",
NULL
};

/* Define which symbols are not mandatory */
const enum riot_symbol_values riot_optional_symbols[] = {
RIOT_NAME_OFFSET,
};

const struct rtos_type riot_rtos = {
.name = "RIOT",
.detect_rtos = riot_detect_rtos,
.create = riot_create,
.update_threads = riot_update_threads,
.get_thread_reg_list = riot_get_thread_reg_list,
.get_symbol_list_to_lookup = riot_get_symbol_list_to_lookup,
};

static int riot_update_threads(struct rtos *rtos)
{
int retval;
unsigned int tasks_found = 0;
const struct riot_params *param;

if (rtos == NULL)
return -1;

if (rtos->rtos_specific_params == NULL)
return -3;

param = (const struct riot_params *) rtos->rtos_specific_params;

if (rtos->symbols == NULL) {
LOG_ERROR("No symbols for RIOT");
return -4;
}

if (rtos->symbols[RIOT_THREADS_BASE].address == 0) {
LOG_ERROR("Can't find symbol `%s`",
riot_symbol_list[RIOT_THREADS_BASE]);
return -2;
}

/* wipe out previous thread details if any */
rtos_free_threadlist(rtos);

/* Reset values */
rtos->current_thread = 0;
rtos->thread_count = 0;

/* read the current thread id */
int16_t active_pid = 0;
retval = target_read_buffer(rtos->target,
rtos->symbols[RIOT_ACTIVE_PID].address,
sizeof(active_pid),
(uint8_t *)&active_pid);
if (retval != ERROR_OK) {
LOG_ERROR("Can't read symbol `%s`",
riot_symbol_list[RIOT_ACTIVE_PID]);
return retval;
}
rtos->current_thread = active_pid;

/* read the current thread count
* It's `int` in RIOT, but this is Cortex M* only anyway */
int32_t thread_count = 0;
retval = target_read_buffer(rtos->target,
rtos->symbols[RIOT_NUM_THREADS].address,
sizeof(thread_count),
(uint8_t *)&thread_count);
if (retval != ERROR_OK) {
LOG_ERROR("Can't read symbol `%s`",
riot_symbol_list[RIOT_NUM_THREADS]);
return retval;
}
rtos->thread_count = thread_count;

/* read the maximum number of threads */
uint8_t max_threads = 0;
retval = target_read_buffer(rtos->target,
rtos->symbols[RIOT_MAX_THREADS].address,
sizeof(max_threads),
(uint8_t *)&max_threads);
if (retval != ERROR_OK) {
LOG_ERROR("Can't read symbol `%s`",
riot_symbol_list[RIOT_MAX_THREADS]);
return retval;
}

/* Base address of thread array */
uint32_t threads_base = rtos->symbols[RIOT_THREADS_BASE].address;

/* Try to get the offset of tcb_t::name, if absent RIOT wasn't compiled
* with DEVELHELP, so there are no thread names */
uint8_t name_offset = 0;
if (rtos->symbols[RIOT_NAME_OFFSET].address != 0) {
retval = target_read_buffer(rtos->target,
rtos->symbols[RIOT_NAME_OFFSET].address,
sizeof(name_offset),
(uint8_t *)&name_offset);
if (retval != ERROR_OK) {
LOG_ERROR("Can't read symbol `%s`",
riot_symbol_list[RIOT_NAME_OFFSET]);
return retval;
}
}

/* Allocate memory for thread description */
rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_count);

/* Buffer for thread names, maximum to display is 32 */
char buffer[32];

for (unsigned i = 0; i < max_threads; i++) {

/* get pointer to tcb_t */
uint32_t tcb_pointer = 0;
retval = target_read_buffer(rtos->target,
threads_base + (i * 4),
sizeof(tcb_pointer),
(uint8_t *)&tcb_pointer);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

if (tcb_pointer == 0) {
/* PID unused */
continue;
}

/* Index is PID */
rtos->thread_details[tasks_found].threadid = i;

/* read thread state */
uint8_t status = 0;
retval = target_read_buffer(rtos->target,
tcb_pointer + param->thread_status_offset,
sizeof(status),
(uint8_t *)&status);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

/* Search for state */
unsigned int k;
for (k = 0; k < RIOT_NUM_STATES; k++) {
if (riot_thread_states[k].value == status)
break;
}
const char *state_str = (k == RIOT_NUM_STATES) ?
"unknown state" :
riot_thread_states[k].desc;
/* Copy state string */
rtos->thread_details[tasks_found].extra_info_str = malloc(
strlen(state_str) + 1);
strcpy(rtos->thread_details[tasks_found].extra_info_str, state_str);

/* Thread names are only available if compiled with DEVELHELP */
if (name_offset != 0) {
uint32_t name_pointer = 0;
retval = target_read_buffer(rtos->target,
tcb_pointer + name_offset,
sizeof(name_pointer),
(uint8_t *)&name_pointer);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`",
riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

/* read thread name */
retval = target_read_buffer(rtos->target,
name_pointer,
sizeof(buffer),
(uint8_t *)&buffer);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`",
riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

/* Make sure the string in the buffer terminates */
if (buffer[sizeof(buffer) - 1] != 0)
buffer[sizeof(buffer) - 1] = 0;

/* Copy thread name */
rtos->thread_details[tasks_found].thread_name_str = malloc(
strlen(buffer) + 1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, buffer);

} else {
const char no_name[] = "Need DEVELHELP";
rtos->thread_details[tasks_found].thread_name_str = malloc(
strlen(no_name) + 1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, no_name);
}

rtos->thread_details[tasks_found].exists = true;

tasks_found++;
}

return 0;
}

static int riot_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs)
{
int retval;
const struct riot_params *param;

if (rtos == NULL)
return -1;

if (thread_id == 0)
return -2;

if (rtos->rtos_specific_params == NULL)
return -3;

param = (const struct riot_params *) rtos->rtos_specific_params;

/* find the thread with given thread id */
uint32_t threads_base = rtos->symbols[RIOT_THREADS_BASE].address;
uint32_t tcb_pointer = 0;
retval = target_read_buffer(rtos->target,
threads_base + (thread_id * 4),
sizeof(tcb_pointer),
(uint8_t *)&tcb_pointer);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

/* read stack pointer for that thread */
uint32_t stackptr = 0;
retval = target_read_buffer(rtos->target,
tcb_pointer + param->thread_sp_offset,
sizeof(stackptr),
(uint8_t *)&stackptr);
if (retval != ERROR_OK) {
LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]);
return retval;
}

return rtos_generic_stack_read(rtos->target,
stacking_info,
stackptr,
reg_list,
num_regs);
}

static int riot_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
*symbol_list = calloc(
ARRAY_SIZE(riot_symbol_list), sizeof(symbol_table_elem_t));

for (unsigned i = 0; i < ARRAY_SIZE(riot_symbol_list); i++) {
(*symbol_list)[i].symbol_name = riot_symbol_list[i];
(*symbol_list)[i].optional = false;

/* Lookup if symbol is optional */
for (unsigned k = 0; k < sizeof(riot_optional_symbols); k++) {
if (i == riot_optional_symbols[k]) {
(*symbol_list)[i].optional = true;
break;
}
}
}

return 0;
}

static bool riot_detect_rtos(struct target *target)
{
if ((target->rtos->symbols != NULL) &&
(target->rtos->symbols[RIOT_THREADS_BASE].address != 0)) {
/* looks like RIOT */
return true;
}
return false;
}

static int riot_create(struct target *target)
{
unsigned int i = 0;

/* lookup if target is supported by RIOT */
while ((i < RIOT_NUM_PARAMS) &&
(0 != strcmp(riot_params_list[i].target_name, target->type->name))) {
i++;
}
if (i >= RIOT_NUM_PARAMS) {
LOG_ERROR("Could not find target in RIOT compatibility list");
return -1;
}

target->rtos->rtos_specific_params = (void *) &riot_params_list[i];
target->rtos->current_thread = 0;
target->rtos->thread_details = NULL;

/* Stacking is different depending on architecture */
struct armv7m_common *armv7m_target = target_to_armv7m(target);

if (armv7m_target->arm.is_armv6m)
stacking_info = &rtos_riot_cortex_m0_stacking;
else if (is_armv7m(armv7m_target))
stacking_info = &rtos_riot_cortex_m34_stacking;
else {
LOG_ERROR("No stacking info for architecture");
return -1;
}
return 0;
}

+ 3
- 1
src/rtos/rtos.c View File

@@ -37,6 +37,7 @@ extern struct rtos_type embKernel_rtos;
extern struct rtos_type mqx_rtos;
extern struct rtos_type uCOS_III_rtos;
extern struct rtos_type nuttx_rtos;
extern struct rtos_type riot_rtos;
extern struct rtos_type hwthread_rtos;

static struct rtos_type *rtos_types[] = {
@@ -50,6 +51,7 @@ static struct rtos_type *rtos_types[] = {
&mqx_rtos,
&uCOS_III_rtos,
&nuttx_rtos,
&riot_rtos,
&hwthread_rtos,
NULL
};
@@ -619,7 +621,7 @@ int rtos_generic_stack_read(struct target *target,
}

free(stack_data);
/* LOG_OUTPUT("Output register string: %s\r\n", *hex_reg_list); */
/* LOG_OUTPUT("Output register string: %s\r\n", *hex_reg_list);*/
return ERROR_OK;
}



+ 95
- 0
src/rtos/rtos_riot_stackings.c View File

@@ -0,0 +1,95 @@
/***************************************************************************
* Copyright (C) 2015 by Daniel Krebs *
* Daniel Krebs - github@daniel-krebs.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "rtos.h"
#include "target/armv7m.h"
#include "rtos_standard_stackings.h"

/* This works for the M0 and M34 stackings as xPSR is in a fixed
* location
*/
static int64_t rtos_riot_cortex_m_stack_align(struct target *target,
const uint8_t *stack_data, const struct rtos_register_stacking *stacking,
int64_t stack_ptr)
{
const int XPSR_OFFSET = 0x40;
return rtos_Cortex_M_stack_align(target, stack_data, stacking,
stack_ptr, XPSR_OFFSET);
}

/* see thread_arch.c */
static const struct stack_register_offset rtos_riot_cortex_m0_stack_offsets[ARMV7M_NUM_CORE_REGS] = {
{ ARMV7M_R0, 0x24, 32 }, /* r0 */
{ ARMV7M_R1, 0x28, 32 }, /* r1 */
{ ARMV7M_R2, 0x2c, 32 }, /* r2 */
{ ARMV7M_R3, 0x30, 32 }, /* r3 */
{ ARMV7M_R4, 0x14, 32 }, /* r4 */
{ ARMV7M_R5, 0x18, 32 }, /* r5 */
{ ARMV7M_R6, 0x1c, 32 }, /* r6 */
{ ARMV7M_R7, 0x20, 32 }, /* r7 */
{ ARMV7M_R8, 0x04, 32 }, /* r8 */
{ ARMV7M_R9, 0x08, 32 }, /* r9 */
{ ARMV7M_R10, 0x0c, 32 }, /* r10 */
{ ARMV7M_R11, 0x10, 32 }, /* r11 */
{ ARMV7M_R12, 0x34, 32 }, /* r12 */
{ ARMV7M_R13, -2, 32 }, /* sp */
{ ARMV7M_R14, 0x38, 32 }, /* lr */
{ ARMV7M_PC, 0x3c, 32 }, /* pc */
{ ARMV7M_xPSR, 0x40, 32 }, /* xPSR */
};

const struct rtos_register_stacking rtos_riot_cortex_m0_stacking = {
0x44, /* stack_registers_size */
-1, /* stack_growth_direction */
ARMV7M_NUM_CORE_REGS, /* num_output_registers */
rtos_riot_cortex_m_stack_align, /* stack_alignment */
rtos_riot_cortex_m0_stack_offsets /* register_offsets */
};

/* see thread_arch.c */
static const struct stack_register_offset rtos_riot_cortex_m34_stack_offsets[ARMV7M_NUM_CORE_REGS] = {
{ ARMV7M_R0, 0x24, 32 }, /* r0 */
{ ARMV7M_R1, 0x28, 32 }, /* r1 */
{ ARMV7M_R2, 0x2c, 32 }, /* r2 */
{ ARMV7M_R3, 0x30, 32 }, /* r3 */
{ ARMV7M_R4, 0x04, 32 }, /* r4 */
{ ARMV7M_R5, 0x08, 32 }, /* r5 */
{ ARMV7M_R6, 0x0c, 32 }, /* r6 */
{ ARMV7M_R7, 0x10, 32 }, /* r7 */
{ ARMV7M_R8, 0x14, 32 }, /* r8 */
{ ARMV7M_R9, 0x18, 32 }, /* r9 */
{ ARMV7M_R10, 0x1c, 32 }, /* r10 */
{ ARMV7M_R11, 0x20, 32 }, /* r11 */
{ ARMV7M_R12, 0x34, 32 }, /* r12 */
{ ARMV7M_R13, -2, 32 }, /* sp */
{ ARMV7M_R14, 0x38, 32 }, /* lr */
{ ARMV7M_PC, 0x3c, 32 }, /* pc */
{ ARMV7M_xPSR, 0x40, 32 }, /* xPSR */
};

const struct rtos_register_stacking rtos_riot_cortex_m34_stacking = {
0x44, /* stack_registers_size */
-1, /* stack_growth_direction */
ARMV7M_NUM_CORE_REGS, /* num_output_registers */
rtos_riot_cortex_m_stack_align, /* stack_alignment */
rtos_riot_cortex_m34_stack_offsets /* register_offsets */
};

+ 32
- 0
src/rtos/rtos_riot_stackings.h View File

@@ -0,0 +1,32 @@
/***************************************************************************
* Copyright (C) 2015 by Daniel Krebs *
* Daniel Krebs - github@daniel-krebs.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifndef OPENOCD_RTOS_RTOS_RIOT_STACKINGS_H
#define OPENOCD_RTOS_RTOS_RIOT_STACKINGS_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "rtos.h"

extern const struct rtos_register_stacking rtos_riot_cortex_m0_stacking;
extern const struct rtos_register_stacking rtos_riot_cortex_m34_stacking;

#endif /* OPENOCD_RTOS_RTOS_RIOT_STACKINGS_H */


+ 2
- 0
src/rtt/Makefile.am View File

@@ -0,0 +1,2 @@
noinst_LTLIBRARIES += %D%/librtt.la
%C%_librtt_la_SOURCES = %D%/rtt.c %D%/rtt.h

+ 521
- 0
src/rtt/rtt.c View File

@@ -0,0 +1,521 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <stdbool.h>
#include <string.h>

#include <helper/log.h>
#include <helper/list.h>
#include <target/target.h>
#include <target/rtt.h>

#include "rtt.h"

static struct rtt_source global_source;
static struct rtt_control global_ctrl;
static struct target *global_target;
static target_addr_t global_addr;
static uint32_t global_length;
static char global_id[RTT_MAX_CB_ID_LENGTH];
static size_t global_id_length;
static bool global_configured;
static bool global_started;
static bool global_changed;
static bool global_found_cb;

static struct rtt_sink_list **global_sink_list;
static size_t global_sink_list_length;

int rtt_init(void)
{
global_sink_list_length = 1;
global_sink_list = calloc(global_sink_list_length,
sizeof(struct rtt_sink_list *));

if (!global_sink_list)
return ERROR_FAIL;

global_sink_list[0] = NULL;
global_started = false;

return ERROR_OK;
}

int rtt_exit(void)
{
free(global_sink_list);

return ERROR_OK;
}

static int read_channel_callback(void *user_data)
{
int ret;

ret = global_source.read(&global_ctrl, global_sink_list,
global_sink_list_length, global_target, NULL);

if (ret != ERROR_OK) {
target_unregister_timer_callback(&read_channel_callback, NULL);
global_source.stop(global_target, NULL);
return ret;
}

return ERROR_OK;
}

int rtt_register_source(const struct rtt_source source, struct target *target)
{
global_source = source;
global_target = target;

return ERROR_OK;
}

int rtt_start(void)
{
int ret;
target_addr_t addr = global_addr;

if (global_started) {
LOG_INFO("RTT already started");
return ERROR_OK;
}

if (!global_found_cb || global_changed) {
global_source.find_cb(&addr, global_length, global_id,
global_id_length, &global_found_cb, global_target, NULL);

global_changed = false;

if (global_found_cb) {
LOG_INFO("RTT control block found at 0x%" TARGET_PRIxADDR, addr);
global_ctrl.address = addr;
} else {
LOG_INFO("No RTT control block found");
return ERROR_OK;
}
}

ret = global_source.read_cb(global_ctrl.address, &global_ctrl,
global_target, NULL);

if (ret != ERROR_OK)
return ret;

ret = global_source.start(&global_ctrl, global_target, NULL);

if (ret != ERROR_OK)
return ret;

target_register_timer_callback(&read_channel_callback, 100, 1, NULL);
global_started = true;

return ERROR_OK;
}

int rtt_stop(void)
{
int ret;

if (!global_configured) {
LOG_ERROR("RTT is not configured");
return ERROR_FAIL;
}

target_unregister_timer_callback(&read_channel_callback, NULL);
global_started = false;

ret = global_source.stop(global_target, NULL);

if (ret != ERROR_OK)
return ret;

return ERROR_OK;
}

static int adjust_sink_list(size_t length)
{
size_t i;
struct rtt_sink_list **tmp;

if (length <= global_sink_list_length)
return ERROR_OK;

tmp = realloc(global_sink_list, sizeof(struct rtt_sink_list *) * length);

if (!tmp)
return ERROR_FAIL;

for (i = global_sink_list_length; i < length; i++)
tmp[i] = NULL;

global_sink_list = tmp;
global_sink_list_length = length;

return ERROR_OK;
}

int rtt_register_sink(unsigned int channel, rtt_sink_read read,
void *user_data)
{
struct rtt_sink_list *tmp;

if (channel >= global_sink_list_length) {
if (adjust_sink_list(channel + 1) != ERROR_OK)
return ERROR_FAIL;
}

LOG_DEBUG("Registering sink for RTT channel %u", channel);

tmp = malloc(sizeof(struct rtt_sink_list));

if (!tmp)
return ERROR_FAIL;

tmp->read = read;
tmp->user_data = user_data;
tmp->next = global_sink_list[channel];

global_sink_list[channel] = tmp;

return ERROR_OK;
}

int rtt_unregister_sink(unsigned int channel, rtt_sink_read read,
void *user_data)
{
struct rtt_sink_list *sink;
struct rtt_sink_list *prev_sink;

LOG_DEBUG("Unregistering sink for RTT channel %u", channel);

if (channel >= global_sink_list_length)
return ERROR_FAIL;

prev_sink = global_sink_list[channel];

for (sink = global_sink_list[channel]; sink; prev_sink = sink,
sink = sink->next) {
if (sink->read == read && sink->user_data == user_data) {

if (sink == global_sink_list[channel])
global_sink_list[channel] = sink->next;
else
prev_sink->next = sink->next;

free(sink);

return ERROR_OK;
}
}

return ERROR_OK;
}

int rtt_write_channel(unsigned int channel, const uint8_t *buffer,
size_t *length)
{
if (!global_source.write)
return ERROR_FAIL;

if (channel >= global_ctrl.num_up_buffers) {
LOG_WARNING("Down-channel %u is not available", channel);
return ERROR_OK;
}

return global_source.write(&global_ctrl, channel, buffer, length,
global_target, NULL);
}

COMMAND_HANDLER(handle_rtt_setup_command)
{
target_addr_t addr;
uint32_t length;
struct rtt_source source;

if (CMD_ARGC != 3)
return ERROR_COMMAND_SYNTAX_ERROR;

COMMAND_PARSE_NUMBER(target_addr, CMD_ARGV[0], addr);
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length);

global_id_length = strlen(CMD_ARGV[2]);

if (!global_id_length || global_id_length > RTT_MAX_CB_ID_LENGTH) {
LOG_ERROR("Invalid RTT control block ID");
return ERROR_COMMAND_ARGUMENT_INVALID;
}

source.find_cb = &target_rtt_find_control_block;
source.read_cb = &target_rtt_read_control_block;
source.start = &target_rtt_start;
source.stop = &target_rtt_stop;
source.read = &target_rtt_read_callback;
source.write = &target_rtt_write_callback;
source.read_buffer_info = &target_rtt_read_buffer_info;

rtt_register_source(source, get_current_target(CMD_CTX));

global_addr = addr;
global_length = length;
memcpy(global_id, CMD_ARGV[2], global_id_length);
global_changed = true;
global_configured = true;

return ERROR_OK;
}

COMMAND_HANDLER(handle_rtt_start_command)
{
int ret;

if (CMD_ARGC > 0)
return ERROR_COMMAND_SYNTAX_ERROR;

if (global_started) {
LOG_INFO("RTT already started");
return ERROR_OK;
}

if (!global_configured) {
LOG_ERROR("RTT is not configured");
return ERROR_FAIL;
}

ret = rtt_start();

if (ret != ERROR_OK)
return ret;

return ERROR_OK;
}

COMMAND_HANDLER(handle_rtt_stop_command)
{
int ret;

if (CMD_ARGC > 0)
return ERROR_COMMAND_SYNTAX_ERROR;

ret = rtt_stop();

if (ret != ERROR_OK)
return ret;

return ERROR_OK;
}

COMMAND_HANDLER(handle_rtt_channels_command)
{
int ret;
size_t i;
char channel_name[32];
struct rtt_buffer_info info;

if (!global_found_cb) {
LOG_ERROR("RTT control block not available");
return ERROR_FAIL;
}

command_print(CMD, "Channels: up=%u, down=%u",
global_ctrl.num_up_buffers, global_ctrl.num_down_buffers);

LOG_INFO("Up-channels:");

info.name = channel_name;
info.name_length = sizeof(channel_name);

for (i = 0; i < global_ctrl.num_up_buffers; i++) {
ret = global_source.read_buffer_info(&global_ctrl, i,
RTT_CHANNEL_TYPE_UP, &info, global_target, NULL);

if (ret != ERROR_OK)
return ret;

if (!info.size)
continue;

LOG_INFO("%zu: %s %u %u", i, info.name, info.size, info.flags);
}

LOG_INFO("Down-channels:");

for (i = 0; i < global_ctrl.num_down_buffers; i++) {
ret = global_source.read_buffer_info(&global_ctrl, i,
RTT_CHANNEL_TYPE_DOWN, &info, global_target, NULL);

if (ret != ERROR_OK)
return ret;

if (!info.size)
continue;

LOG_INFO("%zu: %s %u %u", i, info.name, info.size, info.flags);
}

return ERROR_OK;
}

static int jim_channel_list(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
int ret;
size_t i;
Jim_Obj *list;
Jim_Obj *channel_list;
char channel_name[128];
struct rtt_buffer_info info;

if (!global_found_cb) {
LOG_ERROR("RTT control block not available");
return ERROR_FAIL;
}

info.name = channel_name;
info.name_length = sizeof(channel_name);

list = Jim_NewListObj(interp, NULL, 0);

channel_list = Jim_NewListObj(interp, NULL, 0);

for (i = 0; i < global_ctrl.num_up_buffers; i++) {
ret = global_source.read_buffer_info(&global_ctrl, i,
RTT_CHANNEL_TYPE_UP, &info, global_target, NULL);

if (ret != ERROR_OK)
return ret;

if (!info.size)
continue;

Jim_Obj *tmp = Jim_NewListObj(interp, NULL, 0);

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"name", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
info.name, -1));

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"size", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
info.size));

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"flags", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
info.flags));

Jim_ListAppendElement(interp, channel_list, tmp);
}

Jim_ListAppendElement(interp, list, channel_list);

channel_list = Jim_NewListObj(interp, NULL, 0);

for (i = 0; i < global_ctrl.num_down_buffers; i++) {
ret = global_source.read_buffer_info(&global_ctrl, i,
RTT_CHANNEL_TYPE_DOWN, &info, global_target, NULL);

if (ret != ERROR_OK)
return ret;

if (!info.size)
continue;

Jim_Obj *tmp = Jim_NewListObj(interp, NULL, 0);

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"name", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
info.name, -1));

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"size", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
info.size));

Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
"flags", -1));
Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
info.flags));

Jim_ListAppendElement(interp, channel_list, tmp);
}

Jim_ListAppendElement(interp, list, channel_list);
Jim_SetResult(interp, list);

return JIM_OK;
}

static const struct command_registration rtt_subcommand_handlers[] = {
{
.name = "setup",
.handler = handle_rtt_setup_command,
.mode = COMMAND_ANY,
.help = "setup RTT",
.usage = "<address> <length> <ID>"
},
{
.name = "start",
.handler = handle_rtt_start_command,
.mode = COMMAND_EXEC,
.help = "start RTT",
.usage = ""
},
{
.name = "stop",
.handler = handle_rtt_stop_command,
.mode = COMMAND_EXEC,
.help = "stop RTT",
.usage = ""
},
{
.name = "channels",
.handler = handle_rtt_channels_command,
.mode = COMMAND_EXEC,
.help = "list available channels",
.usage = ""
},
{
.name = "channellist",
.jim_handler = jim_channel_list,
.mode = COMMAND_EXEC,
.help = "list available channels",
.usage = ""
},
COMMAND_REGISTRATION_DONE
};

static const struct command_registration rtt_command_handlers[] = {
{
.name = "rtt",
.mode = COMMAND_EXEC,
.help = "RTT commands",
.usage = "",
.chain = rtt_subcommand_handlers
},
COMMAND_REGISTRATION_DONE
};

int rtt_register_commands(struct command_context *ctx)
{
return register_commands(ctx, NULL, rtt_command_handlers);
}

+ 119
- 0
src/rtt/rtt.h View File

@@ -0,0 +1,119 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef OPENOCD_RTT_RTT_H
#define OPENOCD_RTT_RTT_H

#include <stdint.h>
#include <stdbool.h>

#include <helper/command.h>
#include <target/target.h>

#define RTT_MAX_CB_ID_LENGTH 16
#define RTT_MIN_BUFFER_SIZE 2
#define RTT_CB_LENGTH (RTT_MAX_CB_ID_LENGTH + 4 + 4)
#define RTT_BUFFER_LENGTH 24

struct rtt_control {
target_addr_t address;
char id[RTT_MAX_CB_ID_LENGTH + 1];
uint32_t num_up_buffers;
uint32_t num_down_buffers;
};

struct rtt_buffer {
target_addr_t address;
target_addr_t name_addr;
target_addr_t buffer_addr;
uint32_t size;
uint32_t write_offset;
uint32_t read_offset;
uint32_t flags;
};

struct rtt_buffer_info {
char *name;
size_t name_length;
uint32_t size;
uint32_t flags;
};

typedef int (*rtt_sink_read)(unsigned int channel, const uint8_t *buffer,
size_t length, void *user_data);

struct rtt_sink_list {
rtt_sink_read read;
void *user_data;

struct rtt_sink_list *next;
};

enum rtt_channel_type {
RTT_CHANNEL_TYPE_UP,
RTT_CHANNEL_TYPE_DOWN
};

typedef int (*rtt_source_find_ctrl_block)(target_addr_t *address,
size_t length, const char *id, size_t id_length, bool *found,
struct target *target, void *user_data);
typedef int (*rtt_source_read_ctrl_block)(target_addr_t address,
struct rtt_control *ctrl_block, struct target *target,
void *user_data);
typedef int (*rtt_source_read_buffer_info)(const struct rtt_control *ctrl,
unsigned int channel, enum rtt_channel_type type,
struct rtt_buffer_info *info, struct target *target, void *user_data);
typedef int (*rtt_source_start)(const struct rtt_control *ctrl,
struct target *target, void *user_data);
typedef int (*rtt_source_stop)(struct target *target, void *user_data);
typedef int (*rtt_source_read)(const struct rtt_control *ctrl,
struct rtt_sink_list **sinks, size_t num_channels,
struct target *target, void *user_data);
typedef int (*rtt_source_write)(struct rtt_control *ctrl,
unsigned int channel, const uint8_t *buffer, size_t *length,
struct target *target, void *user_data);

struct rtt_source {
rtt_source_find_ctrl_block find_cb;
rtt_source_read_ctrl_block read_cb;
rtt_source_read_buffer_info read_buffer_info;
rtt_source_start start;
rtt_source_stop stop;
rtt_source_read read;
rtt_source_write write;
};

int rtt_init(void);
int rtt_exit(void);

int rtt_register_source(const struct rtt_source source, struct target *target);

int rtt_start(void);
int rtt_stop(void);

int rtt_register_sink(unsigned int channel, rtt_sink_read read,
void *user_data);
int rtt_unregister_sink(unsigned int channel, rtt_sink_read read,
void *user_data);

int rtt_write_channel(unsigned int channel, const uint8_t *buffer,
size_t *length);

int rtt_register_commands(struct command_context *ctx);

#endif /* OPENOCD_RTT_RTT_H */

+ 3
- 1
src/server/Makefile.am View File

@@ -8,7 +8,9 @@ noinst_LTLIBRARIES += %D%/libserver.la
%D%/gdb_server.h \
%D%/server_stubs.c \
%D%/tcl_server.c \
%D%/tcl_server.h
%D%/tcl_server.h \
%D%/rtt_server.c \
%D%/rtt_server.h

%C%_libserver_la_CFLAGS = $(AM_CFLAGS)
if IS_MINGW


+ 182
- 0
src/server/rtt_server.c View File

@@ -0,0 +1,182 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <rtt/rtt.h>

#include "server.h"
#include "rtt_server.h"

/**
* @file
*
* RTT server.
*
* This server allows access to Real Time Transfer (RTT) channels via TCP
* connections.
*/

struct rtt_service {
unsigned int channel;
};

static int read_callback(unsigned int channel, const uint8_t *buffer,
size_t length, void *user_data)
{
int ret;
struct connection *connection;
size_t offset;

connection = (struct connection *)user_data;
offset = 0;

while (offset < length) {
ret = connection_write(connection, buffer + offset, length - offset);

if (ret < 0) {
LOG_ERROR("Failed to write data to socket.");
return ERROR_FAIL;
}

offset += ret;
}

return ERROR_OK;
}

static int rtt_new_connection(struct connection *connection)
{
int ret;
struct rtt_service *service;

service = connection->service->priv;

LOG_DEBUG("New connection for RTT channel %u", service->channel);

ret = rtt_register_sink(service->channel, &read_callback, connection);

if (ret != ERROR_OK)
return ret;

return ERROR_OK;
}

static int rtt_connection_closed(struct connection *connection)
{
struct rtt_service *service;

service = (struct rtt_service *)connection->service->priv;
rtt_unregister_sink(service->channel, &read_callback, connection);

LOG_DEBUG("Connection for RTT channel %u closed", service->channel);

return ERROR_OK;
}

static int rtt_input(struct connection *connection)
{
int bytes_read;
unsigned char buffer[1024];
struct rtt_service *service;
size_t length;

service = (struct rtt_service *)connection->service->priv;
bytes_read = connection_read(connection, buffer, sizeof(buffer));

if (!bytes_read)
return ERROR_SERVER_REMOTE_CLOSED;
else if (bytes_read < 0) {
LOG_ERROR("error during read: %s", strerror(errno));
return ERROR_SERVER_REMOTE_CLOSED;
}

length = bytes_read;
rtt_write_channel(service->channel, buffer, &length);

return ERROR_OK;
}

COMMAND_HANDLER(handle_rtt_start_command)
{
int ret;
struct rtt_service *service;

if (CMD_ARGC != 2)
return ERROR_COMMAND_SYNTAX_ERROR;

service = malloc(sizeof(struct rtt_service));

if (!service)
return ERROR_FAIL;

COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], service->channel);

ret = add_service("RTT", CMD_ARGV[0], CONNECTION_LIMIT_UNLIMITED,
rtt_new_connection, rtt_input, rtt_connection_closed, service);

if (ret != ERROR_OK) {
free(service);
return ERROR_FAIL;
}

return ERROR_OK;
}

COMMAND_HANDLER(handle_rtt_stop_command)
{
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;

remove_service("RTT", CMD_ARGV[0]);

return ERROR_OK;
}

static const struct command_registration rtt_subcommand_handlers[] = {
{
.name = "start",
.handler = handle_rtt_start_command,
.mode = COMMAND_ANY,
.help = "Start a RTT server",
.usage = "<port> <channel>"
},
{
.name = "stop",
.handler = handle_rtt_stop_command,
.mode = COMMAND_ANY,
.help = "Stop a RTT server",
.usage = "<port>"
},
COMMAND_REGISTRATION_DONE
};

static const struct command_registration rtt_command_handlers[] = {
{
.name = "rttserver",
.mode = COMMAND_ANY,
.help = "RTT server",
.usage = "",
.chain = rtt_subcommand_handlers
},
COMMAND_REGISTRATION_DONE
};

int rtt_server_register_commands(struct command_context *ctx)
{
return register_commands(ctx, NULL, rtt_command_handlers);
}

+ 26
- 0
src/server/rtt_server.h View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef OPENOCD_SERVER_RTT_SERVER_H
#define OPENOCD_SERVER_RTT_SERVER_H

#include <helper/command.h>

int rtt_server_register_commands(struct command_context *ctx);

#endif /* OPENOCD_SERVER_RTT_SERVER_H */

+ 5
- 2
src/target/Makefile.am View File

@@ -44,7 +44,9 @@ TARGET_CORE_SRC = \
%D%/target_request.c \
%D%/testee.c \
%D%/semihosting_common.c \
%D%/smp.c
%D%/smp.c \
%D%/smp.c \
%D%/rtt.c

ARMV4_5_SRC = \
%D%/armv4_5.c \
@@ -243,7 +245,8 @@ ESIRISC_SRC = \
%D%/esirisc.h \
%D%/esirisc_jtag.h \
%D%/esirisc_regs.h \
%D%/esirisc_trace.h
%D%/esirisc_trace.h \
%D%/rtt.h

include %D%/openrisc/Makefile.am
include %D%/riscv/Makefile.am

+ 20
- 0
src/target/arm_adi_v5.c View File

@@ -731,6 +731,26 @@ int dap_dp_init(struct adiv5_dap *dap)
return retval;
}

/**
* Deinitialize a DAP. This turns off power to the debug domain.
*
* @param dap The DAP being initialized.
*/
int dap_dp_uninit(struct adiv5_dap *dap)
{
int retval;

LOG_DEBUG("%s", adiv5_dap_name(dap));

/* Deassert CDBGPWRUPREQ and CSYSPWRUPREQ */
dap->dp_ctrl_stat = 0;
retval = dap_queue_dp_write(dap, DP_CTRL_STAT, dap->dp_ctrl_stat);
if (retval != ERROR_OK)
return retval;

return dap_run(dap);
}

/**
* Initialize a DAP. This sets up the power domains, prepares the DP
* for further use, and arranges to use AP #0 for all AP operations


+ 3
- 0
src/target/arm_adi_v5.h View File

@@ -552,6 +552,9 @@ int mem_ap_write_buf_noincr(struct adiv5_ap *ap,
int dap_dp_init(struct adiv5_dap *dap);
int mem_ap_init(struct adiv5_ap *ap);

/* Deinitialisation of the debug system and power domains */
int dap_dp_uninit(struct adiv5_dap *dap);

/* Invalidate cached DP select and cached TAR and CSW of all APs */
void dap_invalidate_cache(struct adiv5_dap *dap);



+ 2
- 0
src/target/cortex_m.c View File

@@ -1800,6 +1800,8 @@ void cortex_m_deinit_target(struct target *target)
{
struct cortex_m_common *cortex_m = target_to_cm(target);

dap_dp_uninit(cortex_m->armv7m.debug_ap->dap);

free(cortex_m->fp_comparator_list);

cortex_m_dwt_free(target);


+ 413
- 0
src/target/rtt.c View File

@@ -0,0 +1,413 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stddef.h>
#include <stdint.h>
#include <helper/log.h>
#include <helper/binarybuffer.h>
#include <helper/command.h>
#include <rtt/rtt.h>

#include "target.h"

static uint8_t rtt_buffer[1024];

static int read_rtt_buffer(struct target *target,
const struct rtt_control *ctrl, unsigned int channel,
enum rtt_channel_type type, struct rtt_buffer *buffer)
{
int ret;
uint8_t buf[RTT_BUFFER_LENGTH];
target_addr_t address;

address = ctrl->address + RTT_CB_LENGTH + (channel * RTT_BUFFER_LENGTH);

if (type == RTT_CHANNEL_TYPE_DOWN)
address += ctrl->num_up_buffers * RTT_BUFFER_LENGTH;

ret = target_read_buffer(target, address, RTT_BUFFER_LENGTH, buf);

if (ret != ERROR_OK)
return ret;

buffer->address = address;
buffer->name_addr = buf_get_u32(buf, 0, 32);
buffer->buffer_addr = buf_get_u32(buf + 4, 0, 32);
buffer->size = buf_get_u32(buf + 8, 0, 32);
buffer->write_offset = buf_get_u32(buf + 12, 0, 32);
buffer->read_offset = buf_get_u32(buf + 16, 0, 32);
buffer->flags = buf_get_u32(buf + 20, 0, 32);

return ERROR_OK;
}

int target_rtt_start(const struct rtt_control *ctrl, struct target *target,
void *user_data)
{
return ERROR_OK;
}

int target_rtt_stop(struct target *target, void *user_data)
{
return ERROR_OK;
}

static int read_buffer_name(struct target *target, target_addr_t address,
char *name, size_t length)
{
size_t offset;

offset = 0;

while (offset < length) {
int ret;
size_t tmp;

tmp = MIN(32, length - offset);
ret = target_read_buffer(target, address + offset, tmp,
(uint8_t *)name + offset);

if (ret != ERROR_OK)
return ret;

if (memchr(name + offset, '\0', tmp))
return ERROR_OK;

offset += tmp;
}

name[length - 1] = '\0';

return ERROR_OK;
}

static int write_to_channel(struct target *target,
const struct rtt_buffer *rttbuf, const uint8_t *buffer, size_t *length)
{
int ret;
uint32_t len;

if (!*length)
return ERROR_OK;

if (rttbuf->write_offset == rttbuf->read_offset) {
uint32_t first_length;

len = MIN(*length, rttbuf->size - 1);
first_length = MIN(len, rttbuf->size - rttbuf->write_offset);

ret = target_write_buffer(target,
rttbuf->buffer_addr + rttbuf->write_offset, first_length, buffer);

if (ret != ERROR_OK)
return ret;

ret = target_write_buffer(target, rttbuf->buffer_addr,
len - first_length, buffer + first_length);

if (ret != ERROR_OK)
return ret;
} else if (rttbuf->write_offset < rttbuf->read_offset) {
len = MIN(*length, rttbuf->read_offset - rttbuf->write_offset - 1);

if (!len) {
*length = 0;
return ERROR_OK;
}

ret = target_write_buffer(target,
rttbuf->buffer_addr + rttbuf->write_offset, len, buffer);

if (ret != ERROR_OK)
return ret;
} else {
uint32_t first_length;

len = MIN(*length,
rttbuf->size - rttbuf->write_offset + rttbuf->read_offset - 1);

if (!len) {
*length = 0;
return ERROR_OK;
}

first_length = MIN(len, rttbuf->size - rttbuf->write_offset);

ret = target_write_buffer(target,
rttbuf->buffer_addr + rttbuf->write_offset, first_length, buffer);

if (ret != ERROR_OK)
return ret;

buffer = buffer + first_length;

ret = target_write_buffer(target, rttbuf->buffer_addr,
len - first_length, buffer);

if (ret != ERROR_OK)
return ret;
}

ret = target_write_u32(target, rttbuf->address + 12,
(rttbuf->write_offset + len) % rttbuf->size);

if (ret != ERROR_OK)
return ret;

*length = len;

return ERROR_OK;
}

static bool buffer_is_active(const struct rtt_buffer *buf)
{
if (!buf)
return false;

if (!buf->size)
return false;

return true;
}

int target_rtt_write_callback(struct rtt_control *ctrl,
unsigned int channel, const uint8_t *buffer, size_t *length,
struct target *target, void *user_data)
{
int ret;
struct rtt_buffer rttbuf;

ret = read_rtt_buffer(target, ctrl, channel, RTT_CHANNEL_TYPE_DOWN,
&rttbuf);

if (ret != ERROR_OK) {
LOG_ERROR("Failed to read RTT buffer of down-channel %u", channel);
return ret;
}

if (!buffer_is_active(&rttbuf)) {
LOG_WARNING("Down-channel %u is not active", channel);
return ERROR_OK;
}

if (rttbuf.size < RTT_MIN_BUFFER_SIZE) {
LOG_WARNING("Down-channel %u is not large enough", channel);
return ERROR_OK;
}

ret = write_to_channel(target, &rttbuf, buffer, length);

if (ret != ERROR_OK)
return ret;

LOG_DEBUG("Wrote %zu bytes into RTT down-channel %u", *length, channel);

return ERROR_OK;
}

int target_rtt_read_control_block(target_addr_t address,
struct rtt_control *ctrl, struct target *target, void *user_data)
{
int ret;
uint8_t buf[RTT_CB_LENGTH];

ret = target_read_buffer(target, address, RTT_CB_LENGTH, buf);

if (ret != ERROR_OK)
return ret;

memcpy(ctrl->id, buf, RTT_MAX_CB_ID_LENGTH);
ctrl->id[RTT_MAX_CB_ID_LENGTH] = '\0';
ctrl->num_up_buffers = buf_get_u32(buf + RTT_MAX_CB_ID_LENGTH, 0, 32);
ctrl->num_down_buffers = buf_get_u32(buf + RTT_MAX_CB_ID_LENGTH + 4, 0,
32);

return ERROR_OK;
}

int target_rtt_find_control_block(target_addr_t *address, size_t length,
const char *id, size_t id_length, bool *found, struct target *target,
void *user_data)
{
target_addr_t addr;
uint8_t buf[1024];
size_t j;
size_t start;

*found = false;

j = 0;
start = 0;

LOG_INFO("Searching for RTT control block '%s'", id);

for (addr = 0; addr < length; addr = addr + sizeof(buf)) {
int ret;
size_t i;

ret = target_read_buffer(target, *address + addr, sizeof(buf), buf);

if (ret != ERROR_OK)
return ret;

for (i = 0; i < sizeof(buf); i++) {
if (buf[i] == id[j]) {
j++;
} else {
j = 0;
start = addr + i + 1;
}

if (j == id_length) {
*address = *address + start;
*found = true;
return ERROR_OK;
}
}
}

return ERROR_OK;
}

int target_rtt_read_buffer_info(const struct rtt_control *ctrl,
unsigned int channel, enum rtt_channel_type type,
struct rtt_buffer_info *info, struct target *target, void *user_data)
{
int ret;
struct rtt_buffer rttbuf;

ret = read_rtt_buffer(target, ctrl, channel, type, &rttbuf);

if (ret != ERROR_OK) {
LOG_ERROR("Failed to read RTT buffer of channel %u", channel);
return ret;
}

ret = read_buffer_name(target, rttbuf.name_addr, info->name,
info->name_length);

if (ret != ERROR_OK)
return ret;

info->size = rttbuf.size;
info->flags = rttbuf.flags;

return ERROR_OK;
}

static int read_from_channel(struct target *target,
const struct rtt_buffer *rttbuf, uint8_t *buffer, size_t *length)
{
int ret;
uint32_t len;

if (!*length)
return ERROR_OK;

if (rttbuf->read_offset == rttbuf->write_offset) {
len = 0;
} else if (rttbuf->read_offset < rttbuf->write_offset) {
len = MIN(*length, rttbuf->write_offset - rttbuf->read_offset);

ret = target_read_buffer(target,
rttbuf->buffer_addr + rttbuf->read_offset, len, buffer);

if (ret != ERROR_OK)
return ret;
} else {
uint32_t first_length;

len = MIN(*length,
rttbuf->size - rttbuf->read_offset + rttbuf->write_offset);
first_length = MIN(len, rttbuf->size - rttbuf->read_offset);

ret = target_read_buffer(target,
rttbuf->buffer_addr + rttbuf->read_offset, first_length, buffer);

if (ret != ERROR_OK)
return ret;

ret = target_read_buffer(target, rttbuf->buffer_addr,
len - first_length, buffer + first_length);

if (ret != ERROR_OK)
return ret;
}

if (len > 0) {
ret = target_write_u32(target, rttbuf->address + 16,
(rttbuf->read_offset + len) % rttbuf->size);

if (ret != ERROR_OK)
return ret;
}

*length = len;

return ERROR_OK;
}

int target_rtt_read_callback(const struct rtt_control *ctrl,
struct rtt_sink_list **sinks, size_t num_channels,
struct target *target, void *user_data)
{
size_t channel;

num_channels = MIN(num_channels, ctrl->num_up_buffers);

for (channel = 0; channel < num_channels; channel++) {
int ret;
struct rtt_buffer rttbuf;
size_t length;
struct rtt_sink_list *tmp;

if (!sinks[channel])
continue;

ret = read_rtt_buffer(target, ctrl, channel, RTT_CHANNEL_TYPE_UP,
&rttbuf);

if (ret != ERROR_OK) {
LOG_ERROR("Failed to read RTT buffer of up-channel %zu", channel);
return ret;
}

if (!buffer_is_active(&rttbuf)) {
LOG_WARNING("Up-channel %zu is not active", channel);
continue;
}

if (rttbuf.size < RTT_MIN_BUFFER_SIZE) {
LOG_WARNING("Up-channel %zu is not large enough", channel);
continue;
}

length = sizeof(rtt_buffer);
ret = read_from_channel(target, &rttbuf, rtt_buffer, &length);

if (ret != ERROR_OK) {
LOG_ERROR("Failed to read from RTT up-channel %zu", channel);
return ret;
}

for (tmp = sinks[channel]; tmp; tmp = tmp->next)
tmp->read(channel, rtt_buffer, length, tmp->user_data);
}

return ERROR_OK;
}

+ 46
- 0
src/target/rtt.h View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2016-2017 by Marc Schink
* openocd-dev@marcschink.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef OPENOCD_TARGET_RTT_H
#define OPENOCD_TARGET_RTT_H

#include <stdint.h>
#include <stdbool.h>

#include <target/target.h>
#include <rtt/rtt.h>

int target_rtt_start(const struct rtt_control *ctrl, struct target *target,
void *user_data);
int target_rtt_stop(struct target *target, void *user_data);
int target_rtt_find_control_block(target_addr_t *address, size_t length,
const char *id, size_t id_length, bool *found, struct target *target,
void *uer_data);
int target_rtt_read_control_block(target_addr_t address,
struct rtt_control *ctrl, struct target *target, void *user_data);
int target_rtt_write_callback(struct rtt_control *ctrl,
unsigned int channel, const uint8_t *buffer, size_t *length,
struct target *target, void *user_data);
int target_rtt_read_callback(const struct rtt_control *ctrl,
struct rtt_sink_list **sinks, size_t length, struct target *target,
void *user_data);
int target_rtt_read_buffer_info(const struct rtt_control *ctrl,
unsigned int channel, enum rtt_channel_type type,
struct rtt_buffer_info *info, struct target *target, void *user_data);

#endif /* OPENOCD_TARGET_RTT_H */

+ 12
- 0
tcl/target/cc2538.cfg View File

@@ -43,3 +43,15 @@ jtag configure $_CHIPNAME.jrc -event post-reset "ti_cjtag_to_4pin_jtag $_CHIPNAM
set _TARGETNAME $_CHIPNAME.cpu
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap

# Flash
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x4000
}

$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0

set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME cc2538 0 0 0 0 $_TARGETNAME

Loading…
Cancel
Save