Flash programming lpc1850

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash programming lpc1850

1,362 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Tue Jun 25 05:54:45 MST 2013
Hello,

At first, I'm sorry if I ask beginner questions but I haven't any experience with flash programming.

I want to download a simple program and execute into NOR flash on my MCB1800 board with an Lpc1850 on.
The NOR Flash is a Spansion one with the following ref : S29GL064N

For this I find the application note number "11285" about "Writing a flash programming algorithm for unsupported devices" where they provided a flash driver for my board.

I place it into "lpcxpresso_dir/bin/flash" and try to use it.

The download bar went to 100% and they don't report any error. When I check the memory to check if the  code is in, it is.

But when the download finished, nothing passed. The code don't execute and I have this message : "No source available for "0x1040683c" "

Is it something specific to do for start execution from NOR Flash ?

I'm using LPCXpresso v.5.2.4 Build 2122 on a Windows 7 64bits, with full licence type.
0 Kudos
Reply
26 Replies

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by microeval on Sun Sep 29 23:38:58 MST 2013
Hi devel,

I am new to the NXP-LPC. Can you please suggest me which development boards are supported for LPC 1857 with IAR workbench?.
I want to use the SPI/SSP and USART in the board.

Regards,
Ram.
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by devel@latke.net on Fri Aug 23 23:34:37 MST 2013

Quote:
From your debug log, it looks like you are using LPC-Link2. Unfortunately we don't currently support this as a debug probe for LPC18 targets.



I wish I saw that link to the LPC-Link 2 support page before I ordered the LPC-Link 2, mainly because I wouldn't have ordered one, and instead I would have ordered one of the target boards with the LPC-Link non-2 included.

Any ideas on when support for the LPC-Link 2 for debugging the LPC18xx family will be added to the LPCXpresso suite?

It's somewhat absurd that the various bits and pieces of information for developing for NXP micros seems to be spread out among several vendor websites.
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Fri Jul 05 00:46:52 MST 2013
The text printed on the flash is :
S29GL064N90tfl02
121ff370 L
06 Spansion

But I find out my error. In ResetISR I make a call to my function name SystemInit, and in I do something not compatible with the execution in flash.
Now I can compile and execute code from flash.

I have enough two questions.

I often have an error with "crt_emu_18_43_nxp.exe" who crashed. what is it ?
Is it possible to have the external flash and the external RAM Working together ? I ask this because in the schematic the data and address line are the same for the 2 memories.

Regards,
And thank you very much for your help.
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jul 04 07:55:04 MST 2013
Can you confirm the full text markings on the two memory devices fitted next to the MCU on your board please?

ie if you are holding the board with the ethernet/usb connectors at the top, the UART/CAN connectors on the left,  and the debug connectors on the right - then what are the two large devices "below" the MCU?

Regards,
CodeRedSupport
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jul 04 06:12:07 MST 2013
OK, so you really are using an LPC1850 :)

The test program I used initially here was just a "hello world" type project created by the LPC18 project wizard, with its memory map then modified so that it ran from the external flash.

Thus my test image was much smaller than yours. But I've now also tried programming in a large test image (in Red Suite rather than LPCXpresso, but this should not matter) of approx 1MB in size. This programmed and ran fine.

There are subtle differences in the way that the debug tools have to handle the flashless parts compared to the parts with internal flash (like LPC1857). So I suppose that might be why you see problems and I don't. But in that case I would have thought that we would have seen problems with the (non-Keil) LPC18x0/LPC43x0 boards that we have here with different flash attached to the external memory controller - which we don't.

Regards,
CodeRedSupport
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jul 04 04:47:55 MST 2013
The Text printed is :
LPC1850FET256
PFM906.04                     17
ESD1148ZRY

You don't use specific settings with your test app ?
You take it from an existent example. Can I find it ?

Regards,
0 Kudos
Reply

1,121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jul 04 03:34:00 MST 2013
Please confirm the exact text printed on the top of your LPC18 MCU on your board.

I have tested your driver on an MCB1800 board here - which is fitted with an LPC1857 MCU rather than an LPC1850. Thus I need to change the amount of RAM specified in the linker script (as the LPC1857 has less RAM than the flashless part).

After doing this (and mass erasing the internal flash of the 1857), I can then successfully launch a debug session for a test app which I can see programmed into the spansion external flash and which then executes successfully.

ie - your driver seems to work OK for me.

Regards,
CodeRedSupport
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jul 04 00:44:59 MST 2013
Hi,

When I start debug the application, I see in the memory that there is only "1". But when I test an other little program just to init the memory, I can see my code in.

Is it possible to write something in the memory before starting the application ? Because I have to write some register after each reset to enable the memory controller.

Kind regards,
Maxime
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Wed Jul 03 23:47:10 MST 2013
Hi,

Yes I have test in debug mode, and all the functions are working fine.
Sorry for the late answer, I was in holiday 2 days.

The project is export in attached file. I have to clean it because it was too large.

Kind regards
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sat Jun 29 03:13:06 MST 2013
So if you run the debug driver's debug build configuration (which downloads the basic driver into RAM from a "standard debug session", can you check that it first of all erases and then programs the flash memory?

Might be worth you just exporting and posting your flash driver project.

http://support.code-red-tech.com/CodeRedWiki/ImportExport

Regards,
CodeRedSupport
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jun 27 22:23:24 MST 2013
Yes I have done this. I switch back for EMC32 bits.

Why the memory could not be accessible. When I see the memory in debug mode at beginning of the application, there is only "1" or "F" in hexa.
After if I test the driver in debug mode, and pass the initialization pin to access the memory, I can see my code in.

No idea about what could be provoked this ?
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Thu Jun 27 07:33:15 MST 2013
You did remember to switch your boot config pins back after running from SPIFI ?

HTH!
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jun 27 06:18:24 MST 2013
I try with the lpc-link to load and execute my code in SPIFI and it's working fine.

But about the NOR Flash, it's still impossible to download and execute my code correctly. I don't know why but when the application start, the Memory located at 0x1c000000 isn't available. But after when I try to run the driver to see what is in the memory after initialization I can see my code in.

the new debug log indicate an error which I'm not familiar with.

LPCXpresso Debug Driver v5.2 (Apr 26 2013 19:52:27 - crt_emu_lpc18_43_nxp build 1153)
Found chip XML file in C:/Users/Vulliens.HQ/Documents/LPCXpresso_5.2.4_2122/workspace/UsbEmulator/Debug/LPC1850.xml
Emu(0): Conn&Reset. DpID: 2BA01477. Info: HID64HS12
SWD Frequency: 3000 KHz. RTCK: False. Vector catch: False.
Packet delay: 0  Poll delay: 0.
Loaded MCB1800.cfx: S29GL064N Dual Flash (16MB) Keil_MCB1850_4350 Jun 27 2013 14:50:34  External Flash Device on 32-bit Bus
NXP: LPC1850  Part ID: 0x00000000
Connected: was_reset=true. was_stopped=false
v Registered license, download limit of 128K
Writing 76712 bytes to 1C000000 in Flash (assumed clock: 72.0MHz)
Erased/Wrote page  0-0 with 76712 bytes in 14480msec
Flash write Done
Core reset only (VECTRESET)

Stopped: VectorCatch:HardF (PC was 0x1C2177A0) (VectorCatch)

What could be wrong ?

Thank you for the support, regards
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jun 27 02:06:52 MST 2013
Yes I'm using an lpc-link2. Thank you for the explanation I don't hear about that before.
I will test with an lpc-link shortly and give you a feed back.

Regards,
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jun 27 01:04:29 MST 2013
From your debug log, it looks like you are using LPC-Link2. Unfortunately we don't currently support this as a debug probe for LPC18 targets. For more details please see:

http://support.code-red-tech.com/CodeRedWiki/LPCLink2support

You'll need to use an original LPC-Link (ie a split LPCXpresso board) or else a Red Probe+.

Regards,
CodeRedSupport
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Thu Jun 27 00:54:33 MST 2013
Is there something for initialize pins for the correct memory (SPIFI Flash or NOR Flash) Before executing code? (Like the macro in IAR.)

When this error occurs, i think it looks like the MCU cannot access memory beacause related pins aren't set up.

Regards
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Wed Jun 26 07:46:55 MST 2013
Hello,

I have an lpc 1850 on the board, the jumper are right for boot from spifi.

When I try to debug I always have this error tell that cannot access memory at 0x14003b90.

But this time I have this on the debug console :

Pc: (  0) Reading remote configuration
Hard Fault in FLASH driver
While trying command 1
reg 0 == 14000000
reg 1 == 00000000
reg 2 == 00000001
reg 3 == 00000000
reg 4 == 1000c440
reg 5 == 1000df94
reg 6 == 10081000
reg 7 == 10089fd8
reg 8 == 1000be50
reg 9 == 00000000
reg 10 == 00000000
reg 11 == 00000000
reg 12 == 10081100
reg 13 == 10003280
reg 14 == fffffff1
reg 15 == 10000000
reg 16 == 40000003
reg 17 == 10003280
reg 18 == 100032c0
reg 19 == 00000000

and here is the debug log message :

LPCXpresso Debug Driver v5.2 (Apr 19 2013 02:04:40 - crt_emu_cm_redlink build 24)
Found chip XML file in C:/Users/Vulliens.HQ/Documents/LPCXpresso_5.2.4_2122/workspace/UsbEmulator/Debug/LPC1850.xml
Emu(0): Conn&Reset. DpID: 2BA01477. Info: Redlink: 300567
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Loaded LPC18_43_SPIFI_4MB_64KB.cfx: LPC18/43 4MB(64KB) SPIFI @0x14000000 (Dec  3 2012 10:26:13)  External Flash Device on SPI
Connected: was_reset=false. was_stopped=false
v Registered license, download limit of 128K
Writing 50308 bytes to 14000000 in Flash (assumed clock: unknown)
Erased/Wrote page  0-0 with 50308 bytes in 1920msec
Flash write Done
Stopped (Was Reset)  [Reset from Unknown]


If the gdb traces can also help you to find the issue, I can send too.

But the first thing I want to do isn't to program spifi flash memory. I want to copy and execute my code in external NOR Flash. Where the base address is 0x1c000000.

Because in future project I have to use spifi for another goal.
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Jun 26 07:28:12 MST 2013
So if you are using the MCB1800 board, can you confirm whether your board has an LPC1857 or LPC1850 MCU fitted?

If it has an LPC1857 fitted, then select this as your target MCU and use the internal flash.

If it has an LPC1850 fitted, then first of all check the boot pins...

http://www.keil.com/support/man/docs/mcb1800/mcb1800_su_configuring.htm

It would then be worth trying to program the 4MB SPI flash that the board has fitted...

http://www.keil.com/mcb1800/specs.asp
http://www.keil.com/mcb1800/MCB1800v1-3-schematics.pdf

From the schematics, it looks like this is the same device as used on the NGX Xplorer boards, in which case you could use the LPC18_43_SPIFI_4MB_64KB.cfx flash driver supplied in LPCXpresso.

Regards,
CodeRedSupport
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Wed Jun 26 07:09:42 MST 2013
If you see in the chip specification, this adress locate in ROM memory ...
Nothing could be wrong with it ?

Regards
0 Kudos
Reply

1,122 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by maxtippy on Wed Jun 26 03:16:01 MST 2013
If I manage the memory configuration for try to download code into spi flash memory I get the same error with different value.

Here is the error :

Error in final launch sequence
Failed to execute MI command:
-break-insert -t main
Error message from debugger back end:
Cannot access memory at address 0x14003b90
Cannot access memory at address 0x14003b90

and here is the debug log :

LPCXpresso Debug Driver v5.2 (Apr 19 2013 02:04:40 - crt_emu_cm_redlink build 24)
Found chip XML file in C:/Users/Vulliens.HQ/Documents/LPCXpresso_5.2.4_2122/workspace/UsbEmulator/Debug/LPC1850.xml
Emu(0): Conn&Reset. DpID: 2BA01477. Info: Redlink: 300567
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Loaded LPC18_43_SPIFI_8MB_64KB.cfx: LPC18/43 8MB(64KB) SPIFI @0x14000000 (Dec  3 2012 10:26:05)  External Flash Device on SPI
Connected: was_reset=true. was_stopped=false
v Registered license, download limit of 128K
Writing 50308 bytes to 14000000 in Flash (assumed clock: unknown)
Erased/Wrote page  0-0 with 50308 bytes in 1966msec
Flash write Done
Stopped (Was Reset)  [Reset from Unknown]


But I don't want to download code into spi Flash memory but in the NOR Flash integrated with the board. In the spec the memory region named "16 MB static external memory CS0".
0 Kudos
Reply