Show pagesourceOld revisionsBacklinksExport to PDFBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer RedditRecent ChangesSend via e-MailPrintPermalink × Table of Contents Segger J-Link Introduction Install J-Link Software Debian SW Install Windows SW Install Segger J-Link adapter Firmware update Install & Configure J-Link in GNU MCU Eclipse Install Packs J-Link and Eclipse Segger Real Time Terminal RTT Calling SEGGER_RTT print from within interrupts / make it re-entrant J-Link support for Option bytes and Lock / Unlock Flashing MCU with Segger J-Link Get to know J-Link: Converting on-board ST-Link On-Board into J-Link On-Board ToDo Further Reading Discussion Segger J-Link Introduction Segger provides a probe - J-Link - that can be used for programming and debugging. For non-commercial use Segger offers the low priced J-Link Edu probe. Segger supports the Cortex M7 SWV interface used on OVI40 UI and offers plug-ins for MCU eclipse. For Debug output Segger offers an two options in MCU eclipse: TRACESWO output as defined by CORTEX M7. This requires a dedicated pin, currently used for M3 pushbutton switch Segger Real Time Tracing (RTT) with outputs debug messages in high speed via SWV debug lines (CLK and SWData). No need for an additional line to printout debug messages (as is the case with TRACESWO). The J-Link makes use of the Cortex-M feature, which allows accessing the memory via the debug interface while the target is running. How this works in general is described here. The speed advantage of RTT - according to Segger data - is impressive: RTT speed comparison, from Segger web site here Install J-Link Software Debian SW Install Download .deb J-Link packages from http://www.segger.com/download_jlink.html Download J-link .deb file, open terminal and go to download folder with terminal $ sudo dpkg -i nameofdebpackage.deb Windows SW Install ToDo Segger J-Link adapter Firmware update As part of the Segger J-Link SW pack the “J-Link Configurator” utility. In Windows it can be started using the Windows start menu Segger J-Link Configurator - Firmware update tool Install & Configure J-Link in GNU MCU Eclipse See here Install Packs For installing CMSIS packs see here Install the GNU MCU Eclipse Packs Download CMSIS packs from Keil, see Install local cop of STM32F7 and STM32H7 J-Link and Eclipse Describe Eclipse seetings (MCU, CMSIS, probe settings, …) to use J-link probe on Eclipse with uHSDR Segger Real Time Terminal RTT See here See AN08005 (although this is for Cortex-A / Cortex-R and not the Cortex-M used by OVI40 it still gives some insights) Try RTT on UHSDR - is it really 100 times faster than SWO print and 10.000 times fasster than semi-hosting? Segger says here that Cortex-M supports background memory access and that RTT will have no impact on Cortex-M execution speed RTT target code The RTT target code is shipped as part of the J-Link Software and Documentation Pack which can be downloaded here. The RTT sources can be found in the J-Link software package under: Samples/RTT Calling SEGGER_RTT print from within interrupts / make it re-entrant During RTT output the functions SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() are called by default in RTT, but the function bodies of those functions are empty and need to be implemented according to MCU used and use case. Please implement SEGGER_RTT_LOCK() SEGGER_RTT_UNLOCK() .. and disable interrupts and threads which might use RTT in SEGGER_RTT_LOCK() and enable them again in SEGGER_RTT_UNLOCK(). See [https://mcuoneclipse.com/2014/01/26/entercritical-and-exitcritical-why-things-are-failing-badly/|here]] for a discussion on how to enable / disable interrupts on Cortex-M J-Link support for Option bytes and Lock / Unlock Segger provides a “STM32 unlock” utility as part of the standard J-Link SW pack. The tool can be started in Windows using the “start” menue and resets all values to factory default: Segger J-Link STM32 unlock utility Note: The unlock utility resets the brown out reset (BOR) to “level 0”, equalling about 1.7 Volt. Further reading: Check Option Byte support on J-Link, see here and here for a starting point. See here and here See 3.12.2 J-Link STM32 Unlock (Command line tool) in J-Link User Guide J-Link adapter seems to support option byte programming via J-link utility and/or J-Flash utility. This is indicated in previous versions of the J-Link or J-Flash user guides, but not in the current ones. See for example section 7.5.1.2 here ToDo: Verify and try out Flashing MCU with Segger J-Link As part of the Segger J-Link SW pack the flash utility “J-Link lite” is provided. Start J-Flash using Windows “start” button. Note: J-Flash does not support .dfu files. Use the UHSDR .bin files. Load bootloader at address 0x08000000 and load firmware at 0x08010000. Segger J-Flash Lite tool Get to know J-Link: Converting on-board ST-Link On-Board into J-Link On-Board Certain STM32 development boards contain an ST-Link probe. For experiments with J-Link (not related to OVI40, but in order to get to know J-Link HW & SW) the on-board ST-Link board of those boars can be converted to J-Link, see here. Compatible STM32 that can be re-flashed are listed here. ToDo https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/Checkout Segger STM32 support Wiki in general Further Reading J-Link User Guide J-Flash User Guide You could leave a comment if you were logged in. en/uhsdr_dev/segger_j_link.txt Last modified: 27.02.2018 08:46by df9ts_user