Saturday, February 24th 2018, 11:03pm UTC+1

You are not logged in.

  • Login
  • Register

JLindgren

Beginner

Date of registration: Jan 22nd 2018

Posts: 4

1

Monday, January 22nd 2018, 12:36pm

JFlashSPI_CL in Linux for NOR flash memory

Hello,

I'm attempting to use the JLink Plus with the JFlashSPI_CL utility under Linux to erase and program an n25q256a SPI flash memory from Micron. However, I cannot get it to work. I attempt to run the following command:

$ JFlashSPI_CL -connect -open working_base_image.bin 0x0 -speed 20000 -auto
SEGGER J-Flash SPI V6.22d Command Line Version
JLinkARM.dll V6.22d (DLL compiled Dec 14 2017 18:34:21)


Creating new project file [Default.jflash] ...
- New project created successfully
Connecting ...
- Connecting via USB to J-Link device 0
- VTarget = 3.320V
- Read SPI Flash Id = 0x20 BA 19
- Found SPI Flash: Micron N25Q256A
- Connected successfully
Executing init sequence ...
- Executed successfully
Opening data file [working_base_image.bin] ...
- Data file opened successfully (14155776 bytes, 1 range)
Auto programming target (14155776 bytes, 1 range) ...
- Reading affected sectors ...
- Target memory read successfully. (14155776 bytes, 1 range)
- Erasing affected sectors ...
- ERROR: Communication timed out: Requested 2 bytes, received 0 bytes !
- ERROR: Emulator does not support SPI.


If I try to use the GUI version of JFlash SPI under windows, all works well as expected. Is there something I'm missing here or does anyone have any pointers?

Thankful for any help!</infinite>

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

2

Tuesday, January 23rd 2018, 2:29pm

Hello,

Thank you for your inquiry.
The issue was reproducible and is already fixed in our internal build. A fixed release is expected by the end of the week.

Sorry for any inconveniences caused.

Best regards,
Nino

JLindgren

Beginner

Date of registration: Jan 22nd 2018

Posts: 4

3

Wednesday, January 24th 2018, 2:00pm

Hello Nino,

Thank you for the response. I look forward to trying out the new version.

Best regards,

Jesper

JLindgren

Beginner

Date of registration: Jan 22nd 2018

Posts: 4

4

Thursday, February 1st 2018, 1:12pm

Hello again Nino,

I've tried out the new version of the application (V630) and it now works better. However it still does not work completely. When programming the flash memory using JFlashSPI_CL under either Windows or Linux the programmed memory does not represent the binary file that were supposed to be programmed, i.e. when using the GUI version of JFlash to read out the memory contents after programming with JFlashSPI_CL the verification fails. However, when asking JFlashSPI_CL to verify it reports that the verification succeeds (even though I can see that is it not a matched when reading the read out memory using a different tool).

Do you have any idea of what I can do to fix this problem?

Best regards,

Jesper Lindgren

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

5

Thursday, February 1st 2018, 3:23pm

Hello Jesper,

I tried to reproduce this scenario with the latest available J-Link version V6.30a and the issue was not reproducible.
The testfile I used is attached.
Could you try programming that file?
Does a verify work now with the Gui and CL version?

Could you provide the file you were trying to program for reference?

Best regards,
Nino
SEGGER - Nino has attached the following file:
  • testbin.bin (1.05 MB - 14 times downloaded - Last download: Feb 21st 2018, 3:32pm)

JLindgren

Beginner

Date of registration: Jan 22nd 2018

Posts: 4

6

Friday, February 2nd 2018, 2:27pm

Hello Nino,

Using the file you provided it works reliably. However I still cannot get the process to work using my binary file. Sometimes it works, sometimes it fails during erase, and sometimes it fails during verification. Below is a printout from JFlashSPI_CL in Ubuntu 16.04 running in VirtualBox under Windows 10.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
time JFlashSPI_CL -openprj s25fl256s.jflash 
-open _build/img-s25fl256s.bin 0 -auto                                                                    
SEGGER J-Flash SPI V6.30 Command Line Version
JLinkARM.dll V6.30 (DLL compiled Jan 30 2018 18:46:34)

Creating new project file [Default.jflash] ...
- New project created successfully
Close project
- Project closed
Opening project file [s25fl256s.jflash] ...
- Project opened successfully
Opening data file [_build/img-s25fl256s.bin] ...
- Data file opened successfully (14155776 bytes, 1 range)
Auto programming target (14155776 bytes, 1 range) ...
- Connecting ...
  - Connected successfully
- Executing init sequence ...
  - Executed successfully
- Reading affected sectors ...
  - Target memory read successfully. (14155776 bytes, 1 range)
- Erasing affected sectors ...
  - Erase operation completed successfully.
- Programming target (14153728 bytes, 5 ranges) ...
  - Target programmed successfully.
- Verifying target (14153728 bytes, 5 ranges) ...
  - ERROR: Verification failed @ address 0x0000041F (Read: 0x00, Expected: 0x02)
  - ERROR: Failed to verify target.
- Executing exit sequence ...
- ERROR: Failed to auto program target.
Disconnecting ...
- Disconnected
Close project
- Project closed

real    1m5.432s
user    0m12.295s
sys     0m0.850s


I've attached the settings file I'm using. The binary is 13 MB large and I cannot attach it to the forum post as it is too large.

Maybe I'm simply misunderstanding how I should use the tools, but regardless I'm highly appreciative of your help.

Best regards,

Jesper
JLindgren has attached the following file:
  • s25fl256s.jflash (984 Byte - 15 times downloaded - Last download: Feb 22nd 2018, 4:06pm)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

7

Tuesday, February 13th 2018, 10:57am

Hi Jesper,

Thank you for providing the project and binary.
Programming the provided binary worked with both GUI and CL version flawless and the binary content was later also in Flash.

Looking through the jflash project you provided i noticed that it is configured for a Spansion s25fl256 Flash instead of Micron n25q256a as you initially wrote.
It looks like you are trying to program the Micron chip with settings from the Spansion Flash which will not work as they have different commands.

Could you check your project settings once more?

Best regards,
Nino