MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "RockBox",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "2107": {
                "pageid": 2107,
                "ns": 0,
                "title": "Recovering the Bootloader for STAR64 JH7710 over serial using screen",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{Under construction}}\n\n== STAR64 serial wiring ==\nConnect a USB to serial converter cable with 3.3&nbsp;V TTL levels to your STAR64 to the pins 4 (GND), 6 (TXD) and 8 (RXD).\n\nAvoid the pins below pin 6; those are 5&nbsp;V which is enough to mess up most serial cables.\n\n[[File:STAR64-serial-pins.jpg|400px|thumb|left|Serial pins on the STAR64 I/O connector]]\n\n<div style=\"clear: both\"></div>\n== Recovering the Bootloader for STAR64 JH7710 over serial using screen ==\n<syntaxhighlight lang=\"sh\">\ncd <path-to-directory-with-Tools>\nscreen -m -S star64 /dev/ttyUSB0 115200\n# open a second shell\nscreen -S star64 -X exec \\!\\! sx Tools/recovery/jh7110-recovery-20230322.bin\n# type 0 in the first shell\nscreen -S star64 -X exec \\!\\! sx u-boot/spl/u-boot-spl.bin.normal.out # file created with: ../Tools/spl_tool/spl_tool -c -f spl/u-boot-spl.bin\n# type 2 in the first shell\nscreen -S star64 -X exec \\!\\! sx u-boot/u-boot.itb # file created with: tools/mkimage -f ../Tools/uboot_its/visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware u-boot.itb\n</syntaxhighlight>\n\n== Backup current SPI ==\n=== Using Linux ===\nExecute the commands on the star64 (takes some time):\n<syntaxhighlight lang=\"sh\">\ndd if=/dev/mtd0 of=/tmp/star64-factory-spl.bin\ndd if=/dev/mtd1 of=/tmp/star64-factory-uboot.bin\ndd if=/dev/mtd2 of=/tmp/star64-factory-data.bin\n</syntaxhighlight>\n\nExecute on you host:\n<syntaxhighlight lang=\"sh\">\nrsync ${MNAME}:'/tmp/star64-factory-*' .\n</syntaxhighlight>\n\n== References ==\n* [https://github.com/starfive-tech/Tools/blob/master/README.md#recovery Tools README.md about recovery]\n* [https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_QSG.pdf#page=40 VisionFive 2 Single Board Computer Quick Start Guide: 4.4. Recovering the Bootloader p. 40]\n* [https://doc-en.rvspace.org/VisionFive2/PDF/VisionFive2_SDK_QSG.pdf#page=19 VisionFive 2 SDK Quick Start Guide: 7.4. Recovering the Bootloader p. 19]\n\n[[Category:STAR64]]"
                    }
                ]
            },
            "391": {
                "pageid": 391,
                "ns": 0,
                "title": "Reprogramming the PineTime",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "== Introduction ==\n\nThe PineTime Dev Kit comes with the back not glued down to allow it to be easily reprogrammed, however the kit does not include an hardware programmer/debugger. \n\n'''Before you can use your debugger/programmer, you probably have to [[PineTime Devkit Wiring|wire up your pinetime]]. Heavily recommended you read this first!'''\n\nThere is a bewildering variety of different hardware programmers available but whatever programmer you have there are only a few tasks you will have to learn about:\n\n* Unlocking the device '''Note: PineTime watches shipped after 20 Sep 2020 do not require unlocking. They are shipped unlocked.'''\n* Uploading new software\n* Running a debugger\n\nAll of these are described in this article. \n\nUnlocking the device is a one-time action that is needed to enable the debug port and provide full access to the device. Unlocking the device will erase all existing software from the internal flash.\n\n== SWD Pinout ==\n \t\nSee [[PineTime Devkit Wiring]]\n\n== nrfjprog (for Segger JLink) ==\n\nThe following steps have been tested with the Segger JLink embedded in the [https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK NRF52-DK development board].\n\n=== Hookup ===\n\nConnect the Pinetime SWD pins to the debugger (P20 on NRF52-DK)\n\n{| class=\"wikitable\"\n!Pinetime\n!JLink\n|-\n|GND\n|GND\n|-\n|SWDCLK\n|SWDCLK\n|-\n|SWDIO\n|SWDIO\n|-\n|VCC (3.3V)\n|VTG (target detect)\n|}\n\n=== Unlocking the FLASH ===\n\nUnlocking the device and erase the memory. \n\n'''You need to execute this step only once, to remove the read protection on the memory. Note that it will erase the whole flash memory of the MCU!''' :\n \n nrfjprog -f NRF52 --recover\n\n=== Uploading new software ===\n\n1. Program the BLE softdevice (if needed by the firmware). Replace PATH_TO_NRF_SDK by the path where you unzipped the [https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK NRF52 SDK] :\n\n nrfjprog -f NRF52 --program /PATH_TO_NRF_SDK/components/softdevice/s132/hex/s132_nrf52_6.1.1_softdevice.hex --sectorerase\n\n2. Program the firmware (replace firmware.hex by the actual filename of the firmware):\n\n nrfjprog -f NRF52 --program firmware.hex --sectorerase\n\n3. Reset and run the new firmware:\n \n nrfjprog -f NRF52 --reset\n\n== OpenOCD ==\n\nOpenOCD, the Open On-Chip Debugger supports multiple different adapters. You can read more about it here: http://openocd.org/\n\n=== Adapters ===\n\nThese examples allow you to use telnet to issue futher commands to the devkit. Using them you can connect to ''127.0.0.1'' (''localhost'') port ''4444'' using telnet and invoke OpenOCD commands. GDB should also be available on port ''3333''.\n\nYou can simplify your life by creating a configuration file that contains the interface, transport, target and speed configuration. Things like CLion also need one to work properly.\n\nIf you aren't using the latest version of OpenOCD, you might need to substitute things in these examples with older syntax (e.g. instead of ''adapter speed'' it's ''adapter_khz'').\n\n==== CMSIS-DAP ====\n\nThis is a generic specification that is supported by a bunch of different hardware, things such as DAPLink also use it.\n\nIssue this command to initialize a connection to the devkit:\n\n openocd \\\n    -c 'source [find interface/cmsis-dap.cfg]' \\\n    -c 'transport select swd' \\\n    -c 'source [find target/nrf52.cfg]' \\\n    -c 'adapter speed 8000' \\\n    -c 'init'\n\n==== JLink ====\n\nStart OpenOCD:\n\n openocd \\\n    -c 'source [find interface/jlink.cfg]' \\\n    -c 'transport select swd' \\\n    -c 'source [find target/nrf52.cfg]' \\\n    -c 'adapter speed 8000' \\\n    -c 'init'\n\n==== Raspberry Pi ====\n\n openocd \\\n    -c 'source bcm2835spi' \\\n    -c 'bcm2835spi_speed 31200' \\\n    -c 'source [find target/nrf52.cfg]' \\\n    -c 'init'\n\n==== STLink ====\n\nConnect PineTime SWD Pins to ST-Link v2 as follows:\n\n{| class=\"wikitable\"\n!PineTime\n!ST-Link\n|-\n|GND\n|GND\n|-\n|SWDCLK\n|SWDCLK\n|-\n|SWDIO\n|SWDIO\n|-\n|VCC (3.3V)\n|3.3V\n|}\n\n[[File:pinetime-stlink.jpg|400px]]\n\nNote that only the bottom row of pins on ST-Link are used.\n\nTo flash PineTime with ST-Link on Linux and macOS, use [https://github.com/lupyuen/pinetime-updater/blob/master/README.md PineTime Updater]\n\n[[PineTime FAQ|'''ST-Link can't be used to remove nRF52 flash protection''']]\n\n=== Unlocking the device ===\n\nIf you need to disable access port protection then you can do this using the following commands below.\n\nThis can be done in two ways:\n\nAppending this to OpenOCD command line:\n\n  -c 'nrf52.dap apreg 1 0x04' -c 'nrf52.dap apreg 1 0x04 0x01' -c 'nrf52.dap apreg 1 0x04'\n\nOr by using the telnet connection, just type in ''telnet localhost 4444'' and then you can issue commands to OpenOCD:\n\nNote: ''Unlocking the device to remove access port protection will erase the contents of flash.''\n\n  telnet localhost 4444\n    Trying 127.0.0.1...\n    Connected to localhost.\n    Escape character is '^]'.\n    Open On-Chip Debugger\n    > nrf52.dap apreg 1 0x04\n    0x00000000\n    > nrf52.dap apreg 1 0x04 0x01\n    > nrf52.dap apreg 1 0x04\n    0x00000001\n\n(If the ''nrf52.dap'' command cannot be found, try just ''dap'' instead.)\n\n=== Uploading new software ===\n\nJust issue this command, replace ''code.hex'' with your own (and cmsis-dap.cfg with an appropriate adapter).\n\n  openocd \\\n      -c 'source [find interface/cmsis-dap.cfg]' \\\n      -c 'transport select swd' \\\n      -c 'source [find target/nrf52.cfg]' \\\n      -c 'init' \\\n      -c 'halt' \\\n      -c 'nrf5 mass_erase' \\\n      -c 'program code.hex verify' \\\n      -c 'reset' \\\n      -c 'exit'\n\n== Black Magic Probe ==\n\nBlackMagic Probe is an JTAG/SWD adapter with open-source firmware, allowing for it to be ported to a multitude of different boards. One of it's defining features is lack of need for intermediate software such as OpenOCD - one would just need to connect to the GDB server running on the chip and proceed with debugging. For more information, refer to [https://github.com/blacksphere/blackmagic/wiki wiki].\n\n=== Native adapters ===\n\nThe native adapters are the official Black Magic family of debug adapters, including the original Black Magic Probe and the Black Magic Probe Mini. By buying the official hardware you are supporting the continued development of the Black Magic Probe software.\n\nProviding your native adapter is running up-to-date firmware then it can be used to program your PineTime.\n\n=== STM32 (Blue Pill) ===\n\nIt is possible to flash a popular development board based on STM32F103C8T6 microcontroller, known as Blue Pill, to make a BlackMagic Probe device. For example, one may follow instructions in [https://forum.pine64.org/showthread.php?tid=8816&pid=57095#pid57095 forum post] or [https://gist.github.com/darnel/dac1370d057e176386ca4026418abc2b gist] (mac os). Also, it is possible to use SWD pins on the board to flash other devices, instead using arbitrary pins on the board itself. See [https://buger.dread.cz/black-magic-probe-bmp-on-bluepill-stm32f103c8-minimum-system-development-board.html this link] for more detals.\n\n=== Other hardware ===\n\nThe Black Magic Probe firmware can be run on a variety of host devices. See [https://github.com/blacksphere/blackmagic/wiki/Debugger-Hardware BMP Debugger Hardware] for more information.\n\n=== Using the BMP to flash the PineTime ===\n\nRefer to the BMP [https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands wiki] for the full description of commands.\nOverall, the process on Linux is like following. (/dev/ttyBmpGdb is a symlink created by the udev rule). It's useful to create a gdb script file (or .gdbinit) with following commands:\n\n  target extended-remote /dev/ttyBmpGdb\n  monitor swdp_scan\n  attach 1\n  file %firmware file%\n\nThen one may use '''load''' command to flash the firmware, '''compare-sections''' to verify the upload, or '''monitor erase_mass''' to erase the firmware. \n\nThen, proceed with debugging as normal.\n\n== External links and additional tutorials ==\n\n* https://github.com/jlukanc1/pinetime-boot-flasher\n* https://blog.aegrel.ee/absniffer-cmsis-dap-sniffer.html\n* https://blog.dbrgn.ch/2020/5/16/nrf52-unprotect-flash-jlink-openocd/\n* https://medium.com/@ly.lee/openocd-on-raspberry-pi-better-with-swd-on-spi-7dea9caeb590\n* https://medium.com/@ly.lee/build-and-flash-rust-mynewt-firmware-for-pinetime-smart-watch-5e14259c55\n\n[[Category:PineTime]]"
                    }
                ]
            }
        }
    }
}