0

I will use the Jlink Plus in Automated test applications for the ECU (NXP S32K312). I'm in the process of developing a .NET Framework Library (.dll) (API) that is used to control the SEGGER Jlink plus remotely from Test Automation .NET Framework.

I need the following functions which I didn't find in the Jlink.dll from the SDK:

  • Flashing .elf file to ECU

  • Variables Operations : ReadVariable WriteVariable

  • a memory dump of a selected memory section

  • SetBreakpointToFunctionStart(name of function)

  • SetBreakpointToFunctionEnd(name of function)

  • SetBreakpointWhenVariableChange(name of variable)

  • SetBreakpoint

Unfortunately, the Jlink.dll does not support editing and uploading the .elf file. The Jlink.dll supports only the following file types: *.mot • *.srec • *.s19 • *.s • *.hex • *.bin

Therefore I need a tool or a library that can extract the debugging information like (the address and size of the variables in memory) from the .elf file and at the same time be controlled by the .Net framework.

Then I can e.g. pass the address and size of a Jlink.dll and call the JLINKARM_ReadMem() function of Jlink.dll.

Best regards, Abdul

Abdul
  • 1
  • 2
  • For J-Link you just need to download the J-Flash tool. You art not clear on your Toolchain. What plug-in are you using for embedded development in VS? Presumably you are using nanoFramework? ELF file download by be supported by your Toolchain, but you might need J-Flash to support that. To load directly with J-Flash, you would need to generate a HEX file first. – Clifford Jun 10 '22 at 18:53
  • Thank you for your comment. I am using the .NET Framework (Class Library). I work on Test Automation project (Integration Tests based on Hardware in the Loop framework), I develop a library (API) that is used to control the SEGGER Jlink plus remotely from C# framework. That's why the Jflash tool doesn't help me. – Abdul Jun 15 '22 at 15:45
  • Segger offers an SDK in which there is Jlink.dll that can be used to control Jlink segger remotely. But the Jlink.dll does not currently offer APIs for parsing .elf files. So I need a tool to extract the address and size of a specific variable and function in memory from the .elf file. Then I will forward the address to the Jlink.dll. – Abdul Jun 15 '22 at 15:46
  • In that case the title of your question is misleading - that refers only to flashing, not debugging. It is entirely unclear to me what you are trying to do - seems like an X-Y problem. That said the binutils tool `nm` can be used to inspect the content of the elf file, listing all public symbols and addresses, and `objcopy` can extract the binary image, from which you can generate a .hex file which J-Flash _can_ work with. In fact you can probably use the SRecord utility to go directly from elf to hex. – Clifford Jun 15 '22 at 19:48
  • So the code in C# is not the source code for the elf in question, and which you are loading to the target? In which case, why mention it? The J-Link DLL probably supports low level control of the target's OCD, the functions you expect are most likely implemented by the debugger using these primitives. For example setting a breakpoint is matter of setting a breakpoint register in the OCD. So the DLL need only have the ability to access memory and memory mapped registers and nothing more. – Clifford Jun 15 '22 at 19:59
  • You are right, maybe I phrased the question wrong. So I'm trying to do the following, I'm in the process of developing a .NET Framework Library (.dll) that will be used to remotely control the SEGGER debugger JLink Plus. The library must be a wrapper library and controlled by a (Test Automation .NET Framework). – Abdul Jun 22 '22 at 15:20
  • Therefore I need the SEGGER Jlink.dll to develop my library. And unfortunately the Jlink.dll does not currently support editing and uploading an .elf file to the ECU. So now I'm looking for a tool or library that can edit .elf files and with which I can connect my .NET Framework Library. Test automation .NET Framework is already developed and in operation for one project (Hardware in the Loop) and JLink Plus needs to be replaced to another debugger from ISystem. – Abdul Jun 22 '22 at 15:21
  • You are going around in circles, repeating yourself whilst remaining unclear. I still don't understand why you think that the .Net code is relevant if that is not running ion your target. I have already mentioned the tools necessary to generate a HEX file from an elf file. There is nothing unusual about what you are doing. – Clifford Jun 22 '22 at 21:00

0 Answers0