Coder Social home page Coder Social logo

rtl8710-openocd's Introduction

RTL-8710 openocd support

OpenOCD support for RTL8710 and integrated flash.

pins:

SWD

  • SWDIO: GE3
  • SWCLK: GE4

JTAG

  • TRST: GE0
  • TDI: GE1
  • TDO: GE2
  • TMS: GE3
  • TCK: GE4

building:

make

available OpenOCD commands:

rtl8710_flash_read_id

read and parse the jedec id bytes from flash

rtl8710_flash_read_mac

read MAC address from flash memory at 0xA088

rtl8710_flash_mass_erase

erase whole flash

rtl8710_flash_read [filename] [offset] [size]

dump (size) bytes from flash offset (offset) to file (filename)

rtl8710_flash_write [filename] [offset]

write file (filename) to flash offset (offset)

rtl8710_flash_verify [filename] [offset]

compare file (filename) with flash offset (offset)

rtl8710_flash_auto_erase [1/0]

set auto_erase option on/off. flash sectors will be autoerased when writing

rtl8710_flash_auto_verify [1/0]

set auto_verify option on/off. each block of data will be auto verified when writing

examples:

openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read dump.bin 0 1048576" -c "shutdown"
openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_auto_erase 1" -c "rtl8710_flash_auto_verify 1" -c "rtl8710_flash_write dump.bin 0" -c "shutdown"

About

RTL8710 OpenOCD support is created by Rebane ([email protected])

This document and the attached source code is released under GPLv2.

rtl8710-openocd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rtl8710-openocd's Issues

Support for Olimex ARM-USB-OCD-H

I am not (yet) opening a PR for this one because I am not sure my change does not break anything for other platform. Instead, I am documenting my change here for others to find.

@sandeepmistry if you want a PR, just say the word :)

My goal/context is to use openocd with a realtek RTL8710 using my Olimex ARM-USB-OCD-H.

Building this repo did work fine. After connecting everything, I ran into the following issue:

openocd -s script -s <somepath...>/tcl -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read dump.bin 0 1048576" -c "shutdown"
Open On-Chip Debugger 0.10.0+dev-00867-g2b78f65a (2019-05-18-19:11)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
script/rtl8710.ocd:36: Error: DAP name invalid!
in procedure 'script' 
at file "embedded:startup.tcl", line 26
at file "script/rtl8710.ocd", line 36

I could fix it with a small change in the generated script/rtl8710.ocd.
Search for target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME and replace by

set _DAPNAME $_CHIPNAME.dap
dap create $_DAPNAME -chain-position $_TARGETNAME
target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_DAPNAME

File size directive does not work

drasko@Lenin:~/rtl8710/open-ameba$ make flashburn
make[1]: Entering directory '/home/drasko/rtl8710/open-ameba'
Open On-Chip Debugger 0.10.0+dev-00143-gf6449a7c (2017-05-13-23:22)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
swd
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
rtl8710_reboot
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x2ba01477
Info : rtl8710.cpu: hardware has 6 breakpoints, 4 watchpoints
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00000100 msp: 0x1ffffffc
auto erase on
auto verify on
initializing RTL8710 flasher
faultmask (/1): 0x01
sp (/32): 0x20000000
pc (/32): 0x10001000
RTL8710 flasher initialized
sdk/flasher/rtl8710.ocd:261: Error: invalid command name "file"
in procedure 'rtl8710_flash_write' 
at file "sdk/flasher/rtl8710.ocd", line 261
sdk/flasher.mk:126: recipe for target 'flashburn' failed
make[1]: *** [flashburn] Error 1
make[1]: Leaving directory '/home/drasko/rtl8710/open-ameba'
Makefile:25: recipe for target 'flashburn' failed
make: *** [flashburn] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.