Wednesday, April 25th 2018, 10:23pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

delibert

Beginner

Date of registration: Jul 4th 2012

Posts: 2

1

Wednesday, July 4th 2012, 12:50pm

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
2
WARNING: Found 2 regions, but region 0 already occupies the whole flash.
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
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
monitor endian little
monitor reset
monitor WorkRAM = 0x1E000000-0x1E07FFFF
monitor flash CFI = 0x1c000000-0x1c3FFFFF
monitor flash download = 1
monitor flash breakpoints = 1

monitor writeu32 0x40005000 = 0x00000000
monitor sleep 10
monitor writeu32 0x4008609C = 0x000000F3
monitor writeu32 0x400860A0 = 0x000000F3
monitor writeu32 0x400860A4 = 0x000000F3
monitor writeu32 0x400860A8 = 0x000000F3
monitor writeu32 0x400860AC = 0x000000F3
monitor writeu32 0x400860B0 = 0x000000F3
monitor writeu32 0x400860B4 = 0x000000F3
monitor writeu32 0x400860B8 = 0x000000F3
monitor writeu32 0x40086290 = 0x000000F2
monitor writeu32 0x40086294 = 0x000000F2
monitor writeu32 0x40086298 = 0x000000F2
monitor writeu32 0x4008629C = 0x000000F2
monitor writeu32 0x40086280 = 0x000000F2
monitor writeu32 0x40086284 = 0x000000F2
monitor writeu32 0x40086288 = 0x000000F2
monitor writeu32 0x4008628C = 0x000000F2
monitor writeu32 0x40086124 = 0x000000F3
monitor writeu32 0x40086128 = 0x000000F3
monitor writeu32 0x4008612C = 0x000000F3
monitor writeu32 0x40086130 = 0x000000F3
monitor writeu32 0x40086134 = 0x000000F3
monitor writeu32 0x40086080 = 0x000000F2
monitor writeu32 0x40086084 = 0x000000F2
monitor writeu32 0x40086088 = 0x000000F2
monitor writeu32 0x40086120 = 0x000000F3
monitor writeu32 0x4008611C = 0x000000F3
monitor writeu32 0x40086118 = 0x000000F2
monitor writeu32 0x40086108 = 0x000000F2
monitor writeu32 0x40086104 = 0x000000F2
monitor writeu32 0x40086100 = 0x000000F2
monitor writeu32 0x40086320 = 0x000000F1
monitor writeu32 0x4008631C = 0x000000F1
monitor writeu32 0x400866C0 = 0x000000F2
monitor writeu32 0x400866BC = 0x000000F2
monitor writeu32 0x40086700 = 0x000000F3
monitor writeu32 0x40086704 = 0x000000F3
monitor writeu32 0x40086708 = 0x000000F3
monitor writeu32 0x4008670C = 0x000000F3
monitor writeu32 0x40086710 = 0x000000F3
monitor writeu32 0x40086094 = 0x000000F3
monitor writeu32 0x400866B0 = 0x000000F2
monitor writeu32 0x40086098 = 0x000000F3
monitor writeu32 0x4008608C = 0x000000F3
monitor writeu32 0x40086090 = 0x000000F3
monitor writeu32 0x40086318 = 0x000000F1

monitor writeu32 0x40005200 = 0x00000081
monitor writeu32 0x40005208 = 0x00000000
monitor writeu32 0x4000520C = 0x0000000E
monitor writeu32 0x40005240 = 0x00000081
monitor writeu32 0x40005248 = 0x00000000
monitor writeu32 0x4000524C = 0x0000000B

monitor writeu32 0x40005000 = 0x00000001
monitor sleep 10
monitor writeu32 0xE000ED08 = 0x1C000000

Thanks,
Pawel

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,516

2

Wednesday, July 4th 2012, 2:06pm

Hi Pawel,

Quoted

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

delibert

Beginner

Date of registration: Jul 4th 2012

Posts: 2

3

Thursday, July 5th 2012, 9:20am

Quoted

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

Quoted

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