JFlash read not agreeing with IDE on STR912FAW47

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

  • JFlash read not agreeing with IDE on STR912FAW47

    If I do a read entire chip (as it happens just after erasing a sector of flash) using J-flash the returned data implies there is no memory at the address (0x80000) - or I assume it does as it shows "--" for its value. If I go to the IAR debugger it shows FF. Now I am more inclined to believe the J-flash SW but would rather the IAR is right (as it would mean the erase sector call worked).

    Sequence is:-
    1) run jflash - using STR912_Bootbank1.jflash
    2) I select device str912FAW47 Bootbank 1 in the J-link task bar (is there a way of making that sticky please as I seem to need to redo it for each time I run J-flash?)
    3) Erase chip (ok, I know I'm being a bit paranoid)
    it does occasionally throw up an error at this point but just selecting erase chip again works the 2nd time. If useful this is the error
    Erasing chip ...
    - Erasing 40 sectors, 2 ranges, 0x0 - 0x1FFFF, 0x200000 - 0x3FFFFF
    - ERROR: Write memory error @ address 0x50000000, word access: Memory access timeout.
    - ERROR: RAM check failed @ address 0x50000000.
    - ERROR: Write: 0x03020100 07060504
    - ERROR: Read: 0xAAAAAAAA AAAAAAAA
    - ERROR: (0 bytes of RAM have been checked successfully)
    - ERROR: Failed to erase chip

    4) Fill with zero
    5) read back entire chip (at this point the memory @ 0x80000 is shown as "--" in J-flash)
    6) Hit Ctrl-D in IAR and Dl my app - following your previous suggestion that also has no flash loader except the one in the J-link taskbar app. (at this point IAR shows the image at both 0 and 0x80000 according to IAR mem view but still "--" in J-flash [later: I think this duplicatation only happens when I have used J-flash prior to IAR])
    7) run to my code that erases a sector and somehow the memory @ 0x80000 is now 0 according to IAR (which is what it should be) but still "--" in J-flash
    8) run past the code that erases a sector and IAR correctly shows it as FF - J-flash still on "--"

    Sorry there's a lot in there but wanted to give as much hopefully useful data as poss (also quite a few Qus)
  • Hi,

    2) I select device str912FAW47 Bootbank 1 in the J-link task bar (is there a way of making that sticky please as I seem to need to redo it for each time I run J-flash?)

    What is your problem here?
    I do not understand the question...
    If you select the correct device in J-Flash at
    Options -> Project settings -> CPU -> Device
    you are fine and done.

    5) read back entire chip (at this point the memory @ 0x80000 is shown as "--" in J-flash)

    This is correct...
    Do you know what the boot bank switch on the STR912 is doing?
    It switches bank 0 and 1. Note that bank 1 is *smaller* than bank 0.
    So if they are switched, there is a gap between them because bank 1 (now present at 0x0) does not fill the complete memory until bank 0 (now at 0x80000) begins.
    So the area between 0x08000 - 0x7FFFF is undefined in bootbank 1 mode.
    It *may* be read as 0xFF but I do not give you any guarantee...
    So with "--" J-Flash is just telling you that it is undefined memory for J-Flash and so does not have a real value.


    - Alex
    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.
  • Hi,

    Sorry, I had a look at the wrong chip, I was referring to the STR912FAW42...
    Anyhow, the core of my answer remains the same...

    STR912FAW47

    Bank 0: 2048 KB
    Bank 1: 128 KB

    Bootbank 0 mode: Continuous memory from 0x0 - 0x21FFFF
    Bootbank 1 mode:
    Memory 0: 0x00000000 - 0x0001FFFF
    Memory 1: 0x00200000 - 0x003FFFFF (Starting at offset 2 MB!!!)

    So as I said: At 0x80000 (4 0's) there is *no* memory for J-Flash...
    J-Flash does not re-configure the STR912 again for bootbank 1 mode, so that the memory map becomes continuous again.
    It just makes sure that both banks have been switched and not also moved their offsets.


    - Alex
    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.
  • Ta very much! You're absolutely right and it explains an awful lot.


    I have no idea where I got the 0x80000 from :( - at least I have been consistent:-} I have been working based on that for a while and I was sure I'd checked it before I contacted you originally.

    [Later] Ah I see it now. It came from the AN2675 ST document which gives (sort of) guidelines on how to write a boot loader. At least I'm not going totally daft.

    Danke vielmals!!!
  • Thanks for the feedback.
    Does this mean everything is working now?

    - Alex
    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.