Posts by mimlo

    Hello,
    I've been looking for some guide/documentation for L2 verification documentation, which happens after flash download is complete. At the moment of writing this post, I still have no clue what the API should look like - what type of L2 verification (CRC, other) is done by default, how to communicate that to the JLink.
    Since I do not particularly need that feature (although it would be cool to have it)I'm wondering whether it's possible to permanently skip/turn-off L2 verification for a given target/device (as long as it can be done by some script/program/whatever).

    Below you can find similar topic I raised some time ago (without any answer), which describes the problem with a bit more context as per my specific use-case.
    J-Link flash programming - L2 verification

    Best regards,
    Michael

    Hi,
    Honestly, I was looking in the correct place because I initially looked at SEGGER Flash Loader - SEGGER Knowledge Base, which should have led me to what you posted. Somehow I missed that.

    One think that I'm missing (or maybe I do not know about its existence) is some kind of central wiki page for segger from where I could be directed to all those different topics like Flash Loader, Jlink Commander, Scripting, DLL, and other places. Right now, when I'm looking for something that I know should be on your wiki, I need to be directed there by google search, or by search in your wiki.
    However, I think there are lots of cool SEGGER wiki pages about some interesting stuff that I do not even know exist, so having some central point from where I could reach those would definitely be a plus.

    Hello,
    I'd like to use newer JLink software (I'm currently on version 7.92c) for the JLink programmer device to program external memory connected to IMXRT1176 microcontroller.
    I already have a working solution for an older version that I currently use, but I'd like to port the solution to the newer version.

    While wanting to do that, I noticed that from some version of JLink, both Devices directory and JLinkDevices.xml are no longer present in the installation path. That got me thinking, where did all of these .FLM files containing actual flashloaders and corresponding configurations (xml file with entries for each target) for different microcontrollers from different vendor go to?
    Right now, I'm just puzzled and I do not know what is the recommended way when it comes to creation of custom flash loaders - Should I copy-paste Devices directory from previous version of JLink release or there is some other method?

    When it comes to FlashLoader creation I followed the procedure described in the chapter below.

    Creating custom FlashLoader
    From my previous experience, what one needs to do to get a custom flashLoader working is the following:

    1. Build FlashLoader project (I built it in Keil due to specific memory placement of certain data fields and code - it was taken care of by default with Keil), that will implement the OpenFlashLoader interface (Flash Programming Algorithm description, FuncAPI here), github repo with template can be found here, whereas on SEGGER website, there is also THIS template as well
    2. Locate the JLinkDevices.xml to add the new Flashloader algorithm that will be visible in JLink Flash / JLink Commander
    3. Place the previously compiled .FLM file inside Devices directory (the one that is no longer present for newer versions of JLink)
    4. Run JLinkCommander and see if the new device is visible from the tool and if you can actually upload the .hex/.bin file into the memory

    And if everything above goes as planned, new FlashLoader is ready to be used.

    It would be ideal if such procedure would be described on your wiki page - I did not found anything like that.

    Best regards,
    Michael

    Hello,
    I have a custom flash loader that works with JLink and is able to do a basic operations like write, read, erase and L1 verification (L2 is not implemented for now).
    I'm using python pylink library to handle the JLink device and automate these operations via a dedicated script. After flashing an image, It reports errors after flashing the image simply because L2 verification fails if it's not turned off.
    However, it seems that L2 verification is turned on by default. I can turn it off completely, but it requires me to use JLink control panel to do so, but I want to use it from the python perspective so manual configuration is not an option for my case.
    Although I can export the configuration from the control panel (in a form of .jlink file), it seems that it does not distinguish L1 and L2 verification in all of the options is has listed, but just includes "VerifyDownload" parameter which according to my testing can skip L2 verification (I do not get error after flashing when set to 0), but when it's set to 1, I do not know which option it chooses.
    See the attached image which comes from your wiki page

    My questions are the following:
    1. Is *.jlink file the only way to skip L2 verification or is there also some other way to do so (maybe I could send a command to DLL or something)?
    2. Is there any example available (I found none) how can I implement this L2 verification methods? - There is a mention of CRC calculation but it does not provide information about which type of CRC should be used (which polynomial is expected?)

    Best regards,
    Michael

    Hello,

    I have a custom bord with the following hardware configuration:

    • microcontroller: NXP IMXRT1176
    • external memory: Infineon Hyperflash S26HL512T with Hyperbus configuration

    I'd like to use J-Link to handle write, read and erase commands for my microcontroller's memory. I would like to have a possibility to operate it in an autonomous way via python script.
    Even though my uC does not have internal memory, and have specific hyperbus interface to operate the memory, I have a flash loader .FLM file that can write, read and erase the data for that memory.
    I could achieve the above by executing J-Link Commander commands in a python's process, but since there is already pylink library that does that (https://github.com/square/pylink), I thought that I could just reuse it for my purposes.

    If possible, I would like to understand the following topics:
    1. It turned out that pylink works somewhat differently that J-Link Commander. One example is the erase functionality, I can erase by sectors using J-Link Commander, but I can't do the same using pylink that uses Jlink DLL API. I thought both tools use the same DLL underneath (Jlink DLL API does not list Erase sector functionality, it only allows for Erase Chip functionality). For my purpose it's essential to be able to erase by sectors as my memory has 64MB of space and only a tiny portion of it is used, so it's much quicker to erase selective sectors instead of whole chip memory. Even if we do not consider python, but only functions available in from Jlink DLL, then I do not see this possibility I mentioned before.
    Could you explain to me the difference here?

    2. Is it possible to perform memory erase by range of addresses using functions from DLL? If so, I could then implement that on the python side.

    I see that JLINKARM_EndDownload function from Jlink dll have a return value of -4 which says: "Error during verification phase."
    From the examples I see that it's used to actually download the data into the flash memory.
    Do you have a verify function implemented on your flash loader?

    Hello @Simon

    It turned out that error was purely on my side. As stated in the Knowledge Base url you shared, for a new device to be readable by jlink, there is a requirement for the following folder's presence:


    C:\Users\<USER>\AppData\Roaming\SEGGER\JLinkDevices


    "In order to make the J-Link software aware of the new device, the previously created XML file need to be placed in the central JLinkDevices folder.
    If the folder does not exist, it may be created."

    After applying above, the issue was resolved.
    Thank you

    Hi,
    I would like to automate some things like flashing firmware, memory erase, uC reset and alike, for my microcontroller by using jlink.

    I have a custom bord with the following hardware configuration:

    • microcontroller: NXP IMXRT1176
    • external memory: Infineon Hyperflash S26HL512T with Hyperbus configuration

    Since there already is a python library that handles jlink, I would like to use it for my purposes.
    GitHub - square/pylink: Python Library for device debugging/programming via J-Link - github pylink library repository

    With my microcontroller, the type of memory and its configuration, it was stated that custom flash loader is required to allow jlink to perform operations on the memory that is connected to the microcontroller via Hyperbus interface.
    I have custom device configuration definition and jlink compatible .FLM flash loader file that I can use via jlink commander tool - write/read/erase work without any issue, I can also debug the code from non-volatile memory without any issues.

    The problem I have is that pylink can't find the device when I execute jlink.connect method. I assume it is due to the fact that my flashloader is external to what is normally included in the jlink software by default and for some reason built-in ARM DLL does not find the device configuration I added.
    See attached image for reference:

    Index is -1 which suggests it was not found.
    From the pylink python code I see that it fetches device configuration that is based on the index (that is probably where all the connection magic happens). Unfortunately for me, the index is not found as you can see on the image above.

    My guess is that the entire jlink architecture was made this way to be flexible and allow customization, hence the possibility to add and configure custom devices/targets with custom flash loader. Maybe I'm doing something wrong here, or pylink just does not support external flash loaders.
    Maybe it executes incorrect methods/functions from the DLL - hard to tell from my perspective.

    The questions:

    1. Do you know what is the procedure when it comes to custom flash loader and custom device configuration to be able to work with pylink library and jlink DLL?
    2. Is there a simple way to make it work in my case, and if so how?

    Please do let me know if you need any specific information to be able to help.

    Best regards,
    Michal