Tuesday, May 22nd 2018, 11:47pm UTC+2

You are not logged in.

  • Login
  • Register

Date of registration: Mar 28th 2017

Posts: 7

1

Wednesday, April 25th 2018, 11:23am

[SOLVED] JFlashSPI weird behavior

Hi,

I am trying to program SPI flash device - says 25PE16 on the chip (ST part), but when using autodetect on JFlashSPI - it detects N25Q016A (Micron part). When I used autodetect, I was not able to erase or program this device, so I tried to modify project settings (changed ReadStatus to 0x05 and Status Bit position to 0x80, all details attached) and this is the only way I got it working. I saved the project and in the project file I saw, that Status Bit position was saved as 0x80. However, when I start JFlashSPI again, in the program window I see that Status Bit position returns back to 0x07. Needless to say - erasing and programming no long works (but even at this point I can see, that in project file Status Bit position is still 0x80). If I try to use this project file with command line version of JFlashSPI, it does not work as well (log file says that verification failed at the beginning of data).

This is the content of my project file:

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
38
39
40
41
42
43
44
45
  AppVersion = 63200
[GENERAL]
  ConnectMode = 0
  CurrentFile = "C:\TFS\Kaunas\Husqvarna - P25 programming (18-015)\5 Kitron SW\source\SerialFlash.hex"
  DataFileSAddr = 0x00000000
  GUIMode = 0
  HostName = ""
  USBPort = 0
  USBSerialNo = 0x00000000
[JTAG]
  Speed0 = 1000
[FLASH]
  abID[3] = 0x20,0x80,0x15
  AutoDetect = 0x00000000
  NumDice = 0x00000001
  NumPages = 0x00002000
  PageSizeShift = 0x00000008
  SectorSizeShift = 0x00000010
[CPU]
  NumInitSteps = 0
  NumExitSteps = 0
[SPI]
  CmdEnter4ByteMode = 0x00
  CmdEraseBulk = 0xC7
  CmdEraseSector = 0xD8
  CmdExit4ByteMode = 0x00
  CmdReadData = 0x03
  CmdReadID = 0x9F
  CmdReadStatus = 0x05
  CmdWriteDisable = 0x04
  CmdWriteEnable = 0x06
  CmdWritePage = 0x02
  CmdWriteStatus = 0x01
  Dedicated4BAddrMode = 0x00
  NumAddrBytes = 0x03
  StatusBitPos = 0x80
  StatusIsReadyBit = 0x00
[PRODUCTION]
  AutoPerformsErase = 1
  AutoPerformsProgram = 1
  AutoPerformsVerify = 1
  EnableTargetPower = 0
  EraseType = 3
  PerformCompare = 1
  TargetPowerDelay = 0x000000C8



My goal is to set up project file and use it with command line version of JFlashSPI.
Question is: is there a fix/workaround to my current problem?
Thanks!

Regards,
Martynas
m_test_engineer has attached the following image:
  • Project settings.JPG

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Thursday, April 26th 2018, 3:46pm

Hello,

Thank you for your inquiry.
The issue regarding the saving of Bitpos is reproducible and will be fixed in future versions.

Regarding the autodetection.
We could not find any information about an ST 25PE16. Could you provide documentation about that chip?
What is also weird is that you say that a N25Q016A is detected. This device type is not even known to J-Flash SPI so he should not have autodetected this chip.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


Date of registration: Mar 28th 2017

Posts: 7

3

Thursday, April 26th 2018, 4:49pm

Thanks for response, Nino.

When do you think BitPos issue will be fixed? Perhaps with this week's patch update? This is quite an urgent issue.

I attached ST part's datasheet and also screenshot of what I see when I try to autodetect this part with JFlashSPI.

Thanks.

Regards,
Martynas
m_test_engineer has attached the following image:
  • N25Q016A_.jpg
m_test_engineer has attached the following file:
  • datasheet.pdf (366.83 kB - 38 times downloaded - Last download: Yesterday, 9:48am)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Friday, April 27th 2018, 11:02am

Hello Martynas,

Quoted

When do you think BitPos issue will be fixed? Perhaps with this week's patch update? This is quite an urgent issue.

We investigated this further. The issue is related to you setting the busy bit to 0x80. This is an impossible value as all Flash status registers are only 8 bit wide so only values between 0-7 are available. Anything else will be ignored and the last known default value will be loaded.
We will see if we can improve the behaviour so the user gets a warning if an unsupported value is set.
The correct busy bit is 0x00 not 0x80 (see Flash manual). The status register is only 8 bit wide so the value 0x80 can have unwanted side effects.
So simply use 0x00 and you should be good to go.

For future "urgent" cases: if you have an urgent case and are entitled to support contact us per e-mail. This forum is not a support forum so you are not guaranteed to receive an answer here.
More information can be found in the forum rules or my signature.
Same goes for Facebook or other out of order contacts.

Quoted

I attached ST part's datasheet and also screenshot of what I see when I try to autodetect this part with JFlashSPI.

Thanks for providing that. We now know where the wrong autodetection is coming from. Micron has bought up ST's Flash line some time ago which can lead to some inconsistencies with ID detection. We will order a Micron M25PE16 Flash to add official support so auto detection works as well. Unfortunately they are no longer officially available so we will need to order one from Ebay China with a lead time of up to 8 weeks. After we receive the Flash official autodetection support will be added within 1-2 weeks.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


Date of registration: Mar 28th 2017

Posts: 7

5

Friday, April 27th 2018, 3:10pm

Duly noted, Nino.

I think what may be confusing to some of the users (like myself), that bit position setting is displayed in hexadecimal notation. Maybe it is just my mindset, but when I see hexadecimal, I instantly think of bitmask. However that still doesn't explain how I got 0x80 there, since WIP bit is 0. I was looking at a wrong bit.
Thanks for the help so far.

Best regards,
Martynas

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

6

Tuesday, May 15th 2018, 10:16am

Hello Martynas,

We received the ST M25PE16 Flashes and added support.
It will be available with the next release version expected on Friday.
We will consider this thread as solved now.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/