J-Link GDBServer + hitex LPC1850 + can't load external flash

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

  • J-Link GDBServer + hitex LPC1850 + can't load external flash

    Hi,

    I am using J-Link GDB Server 4.50k with CodeSourcery Personal and Hitex LPC1850EVA-A4 evaluation board.

    I wrote EMC (external memory controller) configuration seqence and succesfully tested with J-Flash - memory
    ID was recognized and flash content can be read.

    Example code work when downloaded to internal/external SRAM.

    When I try to downoad example code into external flash, I get the following error in GDB Server log:

    Source Code

    1. WARNING: Found 2 regions, but region 0 already occupies the whole flash.
    2. ERROR: Target system has not enough RAM.


    External flash device is SST39VF3201 and according to datasheet is CFI compliant.
    I am using following gdb commands:

    Source Code

    1. monitor endian little
    2. monitor reset
    3. monitor WorkRAM = 0x1E000000-0x1E07FFFF
    4. monitor flash CFI = 0x1c000000-0x1c3FFFFF
    5. monitor flash download = 1
    6. monitor flash breakpoints = 1
    7. monitor writeu32 0x40005000 = 0x00000000
    8. monitor sleep 10
    9. monitor writeu32 0x4008609C = 0x000000F3
    10. monitor writeu32 0x400860A0 = 0x000000F3
    11. monitor writeu32 0x400860A4 = 0x000000F3
    12. monitor writeu32 0x400860A8 = 0x000000F3
    13. monitor writeu32 0x400860AC = 0x000000F3
    14. monitor writeu32 0x400860B0 = 0x000000F3
    15. monitor writeu32 0x400860B4 = 0x000000F3
    16. monitor writeu32 0x400860B8 = 0x000000F3
    17. monitor writeu32 0x40086290 = 0x000000F2
    18. monitor writeu32 0x40086294 = 0x000000F2
    19. monitor writeu32 0x40086298 = 0x000000F2
    20. monitor writeu32 0x4008629C = 0x000000F2
    21. monitor writeu32 0x40086280 = 0x000000F2
    22. monitor writeu32 0x40086284 = 0x000000F2
    23. monitor writeu32 0x40086288 = 0x000000F2
    24. monitor writeu32 0x4008628C = 0x000000F2
    25. monitor writeu32 0x40086124 = 0x000000F3
    26. monitor writeu32 0x40086128 = 0x000000F3
    27. monitor writeu32 0x4008612C = 0x000000F3
    28. monitor writeu32 0x40086130 = 0x000000F3
    29. monitor writeu32 0x40086134 = 0x000000F3
    30. monitor writeu32 0x40086080 = 0x000000F2
    31. monitor writeu32 0x40086084 = 0x000000F2
    32. monitor writeu32 0x40086088 = 0x000000F2
    33. monitor writeu32 0x40086120 = 0x000000F3
    34. monitor writeu32 0x4008611C = 0x000000F3
    35. monitor writeu32 0x40086118 = 0x000000F2
    36. monitor writeu32 0x40086108 = 0x000000F2
    37. monitor writeu32 0x40086104 = 0x000000F2
    38. monitor writeu32 0x40086100 = 0x000000F2
    39. monitor writeu32 0x40086320 = 0x000000F1
    40. monitor writeu32 0x4008631C = 0x000000F1
    41. monitor writeu32 0x400866C0 = 0x000000F2
    42. monitor writeu32 0x400866BC = 0x000000F2
    43. monitor writeu32 0x40086700 = 0x000000F3
    44. monitor writeu32 0x40086704 = 0x000000F3
    45. monitor writeu32 0x40086708 = 0x000000F3
    46. monitor writeu32 0x4008670C = 0x000000F3
    47. monitor writeu32 0x40086710 = 0x000000F3
    48. monitor writeu32 0x40086094 = 0x000000F3
    49. monitor writeu32 0x400866B0 = 0x000000F2
    50. monitor writeu32 0x40086098 = 0x000000F3
    51. monitor writeu32 0x4008608C = 0x000000F3
    52. monitor writeu32 0x40086090 = 0x000000F3
    53. monitor writeu32 0x40086318 = 0x000000F1
    54. monitor writeu32 0x40005200 = 0x00000081
    55. monitor writeu32 0x40005208 = 0x00000000
    56. monitor writeu32 0x4000520C = 0x0000000E
    57. monitor writeu32 0x40005240 = 0x00000081
    58. monitor writeu32 0x40005248 = 0x00000000
    59. monitor writeu32 0x4000524C = 0x0000000B
    60. monitor writeu32 0x40005000 = 0x00000001
    61. monitor sleep 10
    62. monitor writeu32 0xE000ED08 = 0x1C000000
    Display All

    Thanks,
    Pawel
  • Hi Pawel,

    External flash device is SST39VF3201 and according to datasheet is CFI compliant.


    Unfortunately it is NOT CFI compliant. The CFI information returned by the flash is NOT correct.
    We have improved the CFI detection algorithm so that we can handle these devices in a better way.
    We will check why according to your explanation it works with J-Flash but not with the GDBServer.


    Best regards
    Alex
  • Unfortunately it is NOT CFI compliant.
    Thanks for pointing this out.

    I've done some research and found something that sounds similar (code comes from MTD drivers):

    Source Code

    1. /*
    2. * SST 39VF3201 chips report 2 erase regions while they actually
    3. * only have 1. Patch this on the fly.
    4. */
    5. static void fixup_sst39vf3201_erase_regions(struct mtd_info *mtd, void *param)

    ... it works with J-Flash...
    I have no licence for J-Flash, so I can perform only read operations, but problems probably exist in erase/write operations.

    Thanks,
    Pawel