{"id":24484567,"url":"https://github.com/vojislavm/remote-jlink-programming","last_synced_at":"2025-04-13T18:30:49.899Z","repository":{"id":82831922,"uuid":"266993139","full_name":"VojislavM/remote-jlink-programming","owner":"VojislavM","description":"Remote JLink programming over LAN (nRF52)","archived":false,"fork":false,"pushed_at":"2020-10-01T07:45:23.000Z","size":174,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T09:11:57.685Z","etag":null,"topics":["arm","embedded","jlink","nordicsemi","nrf52","nrf52832","remote","segger"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VojislavM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-26T08:55:49.000Z","updated_at":"2024-09-19T13:50:09.000Z","dependencies_parsed_at":"2023-03-04T19:45:35.232Z","dependency_job_id":null,"html_url":"https://github.com/VojislavM/remote-jlink-programming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VojislavM%2Fremote-jlink-programming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VojislavM%2Fremote-jlink-programming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VojislavM%2Fremote-jlink-programming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VojislavM%2Fremote-jlink-programming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VojislavM","download_url":"https://codeload.github.com/VojislavM/remote-jlink-programming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248760248,"owners_count":21157317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","embedded","jlink","nordicsemi","nrf52","nrf52832","remote","segger"],"created_at":"2025-01-21T13:34:52.515Z","updated_at":"2025-04-13T18:30:49.882Z","avatar_url":"https://github.com/VojislavM.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remote-jlink-programming\n\nIn recent events many have found there selfs at home and not being able to go to office. For me physically this was not something new as I have been working remote for caple of years now and I wanted to show one less known feature of Segger JLink which provides programming interface over the internet as the device you are programming is sitting next to you on the bench. \n\nFor this example I will use the nRF52-DK development board from Nordic Semi. This board has nRF52832 SoC onboard which has Arm® Cortex®-M4 32-bit processor with FPU, 64 MHz, and 512 kB flash/64 kB RAM memory. This will be important later on when we need to figure out the start address for the application firmware. \n\n# server configuration\nThere are three ways how to do programming with JLink and you can read more about it on [Segger website](https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/). I will demonstrate the \"LAN\" way, where the device is connected to one computer using the JLink programmator and I am programming that chip over LAN connection. \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"pics/jlink_server_4.png\"\u003e\n\u003c/p\u003e\n\n * picture source: [link](https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/)\n\nThe computer with the target device has Windows 10 OS and it is a simple process to start the JLink server on it. After installing JLink software search for **SEGGER J-Link Remote Server** and start the application. On first configuration windows select parameters as in the picture:  \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"pics/jlink_server_1.png\"\u003e\n\u003c/p\u003e\n\nAfter the configuration, the server has started and the IP address in my case is as shown in the picture. To be able to see what is happening with the server enables the **show log** configuration for easier tracking.  \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"pics/jlink_server_2.png\"\u003e\n\u003c/p\u003e\n\n# client configuration\n## general configuration\nOn the client-side main development, the machine is using Ubuntu 18.04 LTS OS. This will allow us to easily create scripts that will help us to achieve firmware download over LAN.\n\nFirst it is necessary to install [Segger J-Link software package](https://www.segger.com/downloads/jlink/). After that connection with the server need to be established so the firmware can be downloaded. To do that you can call JLink software from the command line with IP address of server machine as a parameter, for example:\n```bash\n$ JLinkExe ip 192.168.13.229\n```\nThis will get you a connected command line into the remote terminal. You can then start configuration manually in the Jlink terminal by typing `connect` or `help` for more information. But the goal is to this in one \"click\".\nThis is why we will create a script called **flash_remote.sh** with all the commands you would manually type to program MCU on the server-side. \n\n```\nsi SWD\nSpeed 4000\ndevice nrf52832_xxaa\nconnect\nloadbin _build/nrf52832_xxaa.bin 0x00026000\nr\nexit\n```\nTo explain each line so the script is more understandable:\n1. `si SWD` - configures that JLink uses SWD for programming and debugging\n2. `Speed 4000` - configures SWD speed (4000 default value)\n3. `device nrf52832_xxaa` - configures the target device, you can set your own\n4. `connect` - JLink is connecting to the device with previously set parameters\n5. `loadbin _build/nrf52832_xxaa 0x00026000` - loadbin command will take two parameters, first location of application bin file and second start address in memory, and flash the firmware. Start address can be found in the chip documentation or in the linker file of the MCU (for [nRF52 devices memmory](https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/hathach-memory-map)) \n\nnow we can call JLink software with next parameters:\n```bash\n$ JLinkExe ip 192.168.13.229 flash_remote.sh\n```\nand the programm will be downloaded to the MCU.\n\n## using west (zephyr RTOS) tool\nWest is a tool created within the Zephyr RTOS project and among other things, it is used for building and flashing the target MCU. More about the west can be found on the [link](https://docs.zephyrproject.org/latest/guides/west/index.html). Since west does everything for us and calls the required software, jLink in our case, we need to call just one command:\n```bash\nwest flash -r jlink --tool-opt=\"ip xxx.xxx.x.xxx\"\n```\ncommand explanation:\n* `west` - command name\n* `flash` - command parameter to flash the device\n* `-r` - runner, we choose `jlink` instead of `nrfjprog` which is default for nRF dev boards\n* `--tool-opt` - Additional options for JLink Commander, and our additional option is the IP address of the machine with jLink and remote jLink server running.\n\nwith this command, you can flash Zephyr projects to the remote devices.\n\n\n## notes\n* this example was done for a Linux client and in theory it should work on Windows client as well, but it has not been tested. \n\n## references\n1. https://iosoft.blog/category/nordic-nrf52/\n2. http://wiki.hivetool.org/NRF52840_Development\n3. https://docs.electronut.in/papyr/programming_guide/#upload-hex-file\n4. https://aurabindo.in/nordic-and-open-source-goodness/\n5. https://diyiot.wordpress.com/2015/11/29/ble-application-with-nrf51822-firmware-flashing/\n6. https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/\n7. https://docs.zephyrproject.org/latest/guides/west/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvojislavm%2Fremote-jlink-programming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvojislavm%2Fremote-jlink-programming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvojislavm%2Fremote-jlink-programming/lists"}