[SOLVED] JFlashSPI weird behavior

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [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. AppVersion = 63200
    2. [GENERAL]
    3. ConnectMode = 0
    4. CurrentFile = "C:\TFS\Kaunas\Husqvarna - P25 programming (18-015)\5 Kitron SW\source\SerialFlash.hex"
    5. DataFileSAddr = 0x00000000
    6. GUIMode = 0
    7. HostName = ""
    8. USBPort = 0
    9. USBSerialNo = 0x00000000
    10. [JTAG]
    11. Speed0 = 1000
    12. [FLASH]
    13. abID[3] = 0x20,0x80,0x15
    14. AutoDetect = 0x00000000
    15. NumDice = 0x00000001
    16. NumPages = 0x00002000
    17. PageSizeShift = 0x00000008
    18. SectorSizeShift = 0x00000010
    19. [CPU]
    20. NumInitSteps = 0
    21. NumExitSteps = 0
    22. [SPI]
    23. CmdEnter4ByteMode = 0x00
    24. CmdEraseBulk = 0xC7
    25. CmdEraseSector = 0xD8
    26. CmdExit4ByteMode = 0x00
    27. CmdReadData = 0x03
    28. CmdReadID = 0x9F
    29. CmdReadStatus = 0x05
    30. CmdWriteDisable = 0x04
    31. CmdWriteEnable = 0x06
    32. CmdWritePage = 0x02
    33. CmdWriteStatus = 0x01
    34. Dedicated4BAddrMode = 0x00
    35. NumAddrBytes = 0x03
    36. StatusBitPos = 0x80
    37. StatusIsReadyBit = 0x00
    38. [PRODUCTION]
    39. AutoPerformsErase = 1
    40. AutoPerformsProgram = 1
    41. AutoPerformsVerify = 1
    42. EnableTargetPower = 0
    43. EraseType = 3
    44. PerformCompare = 1
    45. TargetPowerDelay = 0x000000C8
    Display All



    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
    Images
    • Project settings.JPG

      54.79 kB, 475×503, viewed 780 times
  • 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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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
    Images
    • N25Q016A_.jpg

      73.7 kB, 235×623, viewed 373 times
    Files
    • datasheet.pdf

      (366.83 kB, downloaded 241 times, last: )
  • Hello Martynas,

    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.

    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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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
  • 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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.