Friday, April 20th 2018, 6:51am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

JosuBasurko

Beginner

Date of registration: Oct 17th 2014

Posts: 6

1

Friday, October 17th 2014, 10:07am

Configure J-Flasher from API-DLL

Good morning,

First of all excuse me in case I am asking a pretty obvious question but I am new to J-Link environment and I haven't been able to find a solution to my problem searching around the available documentation.

I have successfully written an application that is able to flash and secure STM32F217VE, STM32F107VC and EFM32LG295F256 chips via the J-Link API-DLL without using the Segger application. My next goal and the reason for this question is that I want to do the same thing with J-Flasher in order to be able to configure the device and load the data once and flash multiple chips just pushing the button without the need of a computer. And all this just using API-DLL.

In case this may sound strange I currently use this same technique with the MSP-GANG Programmer (http://www.ti.com/tool/msp-gang) for MSP chips successfully.

I am not sure if this is possible with the J-Flasher or I need to pruchase any other SEGGER product or even if this is possible to do at all with any SEGGER product.

Thank you in advance for your help.

Josu

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 377

2

Friday, October 17th 2014, 4:58pm

Hello Josu,

We do not have a product called J-Flasher.
There is a software called J-Flash and the programmer hardware Flasher ARM and Flasher Portable.
Could you please specify which product you are using?

In general programming of multiple chips can be done in three ways:
  1. From the PC by using J-Flash and a Flasher ARM or a J-Link (License required for normal J-Link).
  2. From the PC controlling Flasher ARM via RS232 ASCII interface.
  3. With Flasher ARM in standalone mode, by pressing the program button on the Flasher.
J-Flash is needed to configure Flasher ARM to be able to program the target chip. This is a one time setup.
You will have to create a J-Flash project which includes:
  • the target device settings
  • the target interface settings (JTAG/SWD)
  • additional init and exit steps to be executed before or after programming, like securing the chip
  • the application image to program
For solution 2 and 3 the project and the data file can be loaded into Flasher via J-Flash and allow you to use Flasher ARM in standalone mode.

For additional information the J-Flash User Guide (UM08003) and the Flasher User Guide (UM08022) are included in the J-Link Software Package.

Is this what you are looking for?

Best regards
Johannes

JosuBasurko

Beginner

Date of registration: Oct 17th 2014

Posts: 6

3

Monday, October 20th 2014, 8:51am

Good morning Johannes,

First of all thank you for your quick response and sorry for naming the product wrongly.

As you suggested I am talking about the Flasher ARM hardware and J-Flash software. I have successfully donwloaded a configuration file and a data file to the flasher and then use it with just pushing the button on it. Anyway my goal is to do this same thing but instead of using J-Flash I would like to configure the Flasher ARM directly from the API-DLL.

These would be the steps I would like to run:
  1. Connect the Flasher ARM to a PC
  2. Select a chip in my custom application and load the required configuration and data into the Flasher ARM via API-DLL.
  3. Disconnect the Flasher ARM from the PC.
  4. Flash as much chips as you want just pushing the button.

Thank you in advance for your help.

Josu.

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 377

4

Monday, October 20th 2014, 11:37am

Hello Josu,

Thank you for the clarification.

Generating the configuration and data file for Flasher without J-Flash is currently not possible,
since the data which is loaded to the Flasher is in a proprietary, non-ascii format.

But loading the generated files to the Flasher can be done with the JLINKARM_EMU_FILE_* API functions.

So you could create all configuration and data files with J-Flash and save them on your PC.
The saved files can than be loaded to the Flasher with the JLINKARM_EMU_FILE_* API functions.

Creation of the files can be done without user interaction via the J-Flash command line options "savecfg" and "savedat",
it is also possible do directly download them to flasher from the command line without the need of the J-Link API with "download".

An example call of J-Flash to create and save the configuration and data file would be:

Source code

1
JFlash -openprj"C:\Projects\MyProject.jflash" -open"C:\Data\data.bin",0x08000000 -savecfg"C:\FlasherFiles\FLASHER.CFG" -savedat"C:\FlasherFiles\FLASHER.DAT" -exit


An example call of J-Flash to directly download the files to Flasher would be:

Source code

1
JFlash -openprj"C:\Projects\MyProject.jflash"  -open"C:\Data\data.bin",0x08000000 -download -exit


Would this solution work for you?


We might as well add API functions do directly load J-Flash project files and unmodified data files to Flasher in the future.

Best regards
Johannes

JosuBasurko

Beginner

Date of registration: Oct 17th 2014

Posts: 6

5

Monday, October 20th 2014, 12:43pm

Hello Johannes,

Your answer helped me to solve my doubts.

Thank you for your help.

Josu.