LPC4370 Memory configuration Err

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

LPC4370 Memory configuration Err

1,981 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Sun Jul 12 18:50:39 MST 2015
Dear all,
I have six LPC-Link2 board.
This board used LPC4370. But, used two revision.
http://www.jp.nxp.com/products/related/package-markings.html

1.Line 3 xxxxxxxC
2.Lin3 3 xxxxxxxCY

CY is RevC, but  Y for qualification samples. The CY chip from LabTool bundle board.

This C and CY is different work by Memory Configuration.

This Memory Configuration on WORK on CY chip, but RevC it Not working.
Not work RevC memory configuration. Only RevCY is work.

This Memory Configuration on WORK on both chip(RevC and CY).
Both work memory configuration.

Why two chip different work? This work used check program is LPCOpen "lpcopen_2_12_lpcxpresso_nxp_lpclink2_4370" Peripheral Brinky.
I checked to LPC4370 Memory map.
UM-MemoryMap

I think normally no problem First 128kb Flash area and  ram position is 0x10080000~0x10092000 72kb area.
But, actuary is should be set 0x10000000 to 0x10020000 area on ram by RevC chip.

Why not work same memory configuration different work on chip rev?

Please let me know any answer  and advice.
I feel like this problem is Errata.
six board RevC, three, CY three.....
All board same action working RevCY 128kb Flash area memory configration.
But not working RevC 128kb Flash area configuration.

Following photo is chip marking ex.
RevC released products
RevC Y indicate qualification samples
Labels (1)
0 Kudos
13 Replies

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Thu Jul 16 12:07:02 MST 2015
This problem is very simple.
You say can not 128KB section not use Flash. I changed Flash to RAM.
But, my original memory config is First 128KB area setting is rx. (Read and Execute)
Your setting is rwx.
So, this is two problem.

(CASE1) Working RevCY
My first ld script setting is following.
RamFlash128 (rx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */

(CASE2)Workibng RevC RevCY
Your ld script is following.
RamLoc128 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */

(CASE3)Working RevCY
My second ld script is following.
ROM (rx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */

(CASE4)Working RevC, RevCY
Embedded Artist First setting.
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0x11000 /* 76k of RAM used as ROM */
RAM (rwx) : ORIGIN = 0x10011000, LENGTH = 0x07000  /* 20k of real RAM */

(CASE5)Working RevC, RevCY
Embedded Artist Final setting.(Current)
ROM (rx) : ORIGIN = 0x10000000, LENGTH = 0x11000 /* 76k of RAM used as ROM */
RAM (rwx) : ORIGIN = 0x10011000, LENGTH = 0x07000  /* 20k of real RAM */


I not fixated name. I have to change your recommend name.
This is same main source.
Please notice result. This is very interesting.

1)0x10000000 to 0x20000 96+32KB area, single partition and rx memory config is not working RevC.
2)0x10000000 to 0x18000 96KB area, double partition is working RevC.(not impact rx rwx, need to ROM or RAM + RAM)

This is simple.
Why not working by RevC, same ld script?
Why working difference, RevC RevCY same ld script?

I think RevCY and RevC problem point is ld script memory rx rwx permission.
The CASE2 is evidence. And, have to rwx if we can use 128K(96+32) to 0x1000000  single partition memory config.
But, rx permission setting is can not use 128K single partition. The rx permission setting is only 96K double partitions(ROM or RAM rx + RAM rwx).
This evidence CASE4,5 and https://www.lpcware.com/system/files/Split96k.jpg.

Anyway, I have to recommend debug.

Regards,

0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Jul 16 00:07:56 MST 2015
I am sorry but noone here can understand what your real problem here is - you just seem to have become fixated on changing names of sections in the linker script in non-sensical ways.

As far as we can tell you have boards with two revisions of silicon - and you say one of these does not work, though you do not say in what way.

We have provided a project that we have run here on both these silicon revisions without problem. But you have not said if you have tried using the project we have supplied.

And have you actually tried to run your application under the debugger (using Quickstart -> Debug button) ??

Please try debugging your application using one LPC-Link as the target and another as the debug probe and tell us what difference you see in behaviour whilst debugging on the two silicon revisions. Note that as you do not appear to be wanting to use the onboard external SPIFI flash, you should read this FAQ on debug connections:

https://www.lpcware.com/content/faq/lpcxpresso/debugging-lpc18xxlpc43xx-ram-images

Then provide your test project with details of how to actual replicate the problem.

[list]
  [*]https://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

[/list]
As an aside, you may find this FAQ useful in how to set up one Link2 as the target and one as the probe:
[list]
  [*]  https://www.lpcware.com/content/faq/lpcxpresso/using-lpclink2-as-lpc4370-eval
[/list]

Anyway, unless you can provide a test case and an actual description of the problem and how to replicate it (rather than just endless random changes to linker scripts), we are not going to be able to assist you further in finding the cause of your problems.

Regards,
LPCXpresso Support
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Wed Jul 15 19:07:05 MST 2015
Okay, I have to change Flash to ROM.

This is your ld script.
{
/* Define each memory region */
RamLoc128 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */
RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes */
RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes */
RamM0Sub16 (rwx) : ORIGIN = 0x18000000, LENGTH = 0x4000 /* 16K bytes */
RamM0Sub2 (rwx) : ORIGIN = 0x18004000, LENGTH = 0x800 /* 2K bytes */

}

My binary src periph_blinky_Debug_mem.ld is follwing.
MEMORY
{
/* Define each memory region */
ROM (rx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */
RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes */
RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes */
RamM0Sub16 (rwx) : ORIGIN = 0x18000000, LENGTH = 0x4000 /* 16K bytes */
RamM0Sub2 (rwx) : ORIGIN = 0x18004000, LENGTH = 0x800 /* 2K bytes */

}

But, not working RevC, working RevCY, please explain this problem.
You need to change Flash to RAM. But, not working RevC.

Please notice rx and rwx. ROM area is rx. Embedded Airtst ROM area is rx. this is same.

So, please let me know Flash type and RAM typr ld script IDE and gcc.ld working. I think same. this is just name. Important is rx rwx access.

https://github.com/embeddedartists/labtool/commit/99fdb8eaf4847f419dc8771ee2b0f96b8a2034f5

But he say
"
Hi,
This is not a problem. FLASH is just a name it could be called anything. The comment clearly says "76k of RAM used as ROM".
I have renamed the symbol to ROM instead (see commit 99fdb8e) to possibly make it clearer, but it is only an aesthetic thing as it makes absolutely no difference in the produced binary.
Best Regards,
Anders @ Embedded Artists
"

Yes this is true. ROM Flash RAM important is area and rw,rwx, if same area and same rx, no diiference binary.
You say "Not USE Flash" but just names this Flash. Important is permissions. IDE ld is focus Flash RAM ROM name? if this name is difference final binary is difference?
I don't know. this is just name. GCC-ld is not focus this position name. Only focus permission and area.
So, you not explain RevC and RevCY difference. Please let me know clearly explain to this working difference.

I think you can not deeply understand this issue.



Regards,
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Jul 15 00:15:50 MST 2015
There is no problem in changing the name. But you cannot change its type from RAM to Flash, which is what you did.

rx means read and execute (I.e cannot write,, I.e. Flash)
rwx means read, write and execute (I.e. Ram)
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Tue Jul 14 20:03:53 MST 2015
Why?
ld script RAM ROM FLASH is just name.
important is rw rwx rx any read write etc setting.
Is this true?
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Tue Jul 14 09:35:16 MST 2015

Quote: kazu_zamasu
Thank you.
I think this explain is true. RAM Flash ROM is just name.
Regards,



No, It is more than a name.
Why do you think one needs a driver to access flash regions?
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Tue Jul 14 00:13:38 MST 2015
Thank you.
https://github.com/embeddedartists/labtool/blob/master/fw/gcc_arm.ld

this code is wrong. I under stand.
But, not clear RevCY and RevC working difference.
Why difference?
4chip RevCY is working, 4chip RevC is not working Flash area memory setting.
So, if you are correct, why no alert IDE memory config?

Please see this URL
https://github.com/embeddedartists/labtool/issues/9

I think this explain is true. RAM Flash ROM is just name.
Therefor your binary is changed only name.
Did you have this area do you necessity is rwx?
IDE selected Flash area, normally rw, but your config is RAM therefor rwx.
Regards,
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jul 13 13:10:09 MST 2015
Because it is RAM at that location. IT IS NOT FLASH, SO DO NOT DEFINE IT AS FLASH.
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Mon Jul 13 12:55:20 MST 2015
Thank you for your test and information.
I try to your send binary. Both work RevC and RevCY.
But, I checked to the your src periph_blinky_Debug_mem.ld is following.
MEMORY
{
  /* Define each memory region */
  RamLoc128 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
  RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */
  RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
  RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes */
  RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes */
  RamM0Sub16 (rwx) : ORIGIN = 0x18000000, LENGTH = 0x4000 /* 16K bytes */
  RamM0Sub2 (rwx) : ORIGIN = 0x18004000, LENGTH = 0x800 /* 2K bytes */


}

My binary src periph_blinky_Debug_mem.ld is follwing.
MEMORY
{
  /* Define each memory region */
  RamFlash128 (rx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes */
  RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */
  RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
  RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes */
  RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes */
  RamM0Sub16 (rwx) : ORIGIN = 0x18000000, LENGTH = 0x4000 /* 16K bytes */
  RamM0Sub2 (rwx) : ORIGIN = 0x18004000, LENGTH = 0x800 /* 2K bytes */


}


I think your project memory configuration is all RAM area.
Is this true?
I have some question.
1)Why different working result on 128KB Flash area setting RevC RevCY?
2)Is this true LabTool fw ld script code?
3)Please let me know correct Memory Config.

Regards,
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jul 13 05:24:21 MST 2015
I have just tested the attached project/binary on both C and CY versions on LPC-Link2 and the project works in all circumstances.

I have tested both with the debugger and by using dfu-util.
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Mon Jul 13 02:16:49 MST 2015
New information.

I try to change setting LPC18LPC43ExternalFLASHBootResetscript.scp to LPC18LPC43RamReset.scp.

write command is following.
dfu-util -d 0x1fc9:0x000c -c 0 -i 0 -t 2048 -R -D /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr
"This is same command lpcscrypt_1.5.2_588/scripts/boot_lpcscrypt"
Sample binary is LPCOpen Peripheral Brinky.
Preparation.
1)Use LPCXPresso, build to Peripheral Brinky Project.
2)Use LPCXPresso Create binary.
3)Use lpcscrypt_1.5.2_588/bin/image_manager -i periph_blinky.bin -o periph_blinky.bin.hdr --bin

this project memory configuration Flash 128K RAM72K(Detail capture file)

CASE1 Not working 100% RevC
/boot_lpcscrypt periph_blinky.bin.hdr

CASE2 same time working (about 20% working)
dfu-util -d 0x1fc9:0x000c -c 0 -i 0 -t 2048 -R -D /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr

CASE3 both command line working 100% RevCY

Please see following. This result is same RevC and RevCY.

CASE1 command line.

Kazu-iMac-Develop@Debug:18:08:20:~$/Applications/lpcscrypt_1.5.2_588/scripts/boot_lpcscrypt /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr
Looking for DFU devices...
dfu-util -d 0x1fc9:0x000c -c 0 -i 0 -t 2048 -R -D /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr
Booted LPCScrypt target (0x1fc9:0x000c) with /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr


CASE2 command line.

Kazu-iMac-Develop@Debug:18:08:31:~$dfu-util -d 0x1fc9:0x000c -c 0 -i 0 -t 2048 -R -D /Users/Kazu-iMac-Develop/LPCXpresso/workspace/periph_blinky/Debug/periph_blinky.bin.hdr
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 1fc9:000c
Run-time device DFU version 0100
Claiming USB DFU Runtime Interface...
Determining device status: state = dfuIDLE, status = 0
dfu-util: WARNING: Runtime device already in DFU state ?!?
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0100
Copying data from PC to DFU device
Download[=========================] 100%         7696 bytes
Download done.
dfu-util: unable to read DFU status after completion
dfu-util: can't detach
Resetting USB to switch back to runtime mode
dfu-util: error resetting after download
Kazu-iMac-Develop@Debug:18:08:41:~$

Please any advice.

Regards,
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kazu_zamasu on Mon Jul 13 01:06:06 MST 2015
Yes,not working chip is RevC.
I try checked to my friend and me, total 8 LPC4370chip.
My result is six. RevC not working. RevCY working. half half.
My friend have two LPC4370 LPC-Link2 board. result is same, working RevCY, not working RevC.

So, Why not use 128KB block use to FlashArea.
Please see this URL.
https://github.com/embeddedartists/labtool/blob/master/fw/gcc_arm.ld

this is LabTool firmware ld script. Please notice LINE6.
But, this script is first 96KB RAM area split to 76K Flash 20K RAM.

Please explain to "Why not use change RAM to Flash"
You explain I don't know.
I think Your description is not in the description not working C CY working.

If you this explain is correct, I send to embeddedartists.

Regards,
0 Kudos

1,801 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jul 13 00:20:59 MST 2015
Please can you confirm what exactly does not work on the Rev C chip?

Note that the 128KB block of memory at 0x10000000 is not flash, it is RAM You cannot just change its definition from RAM to flash in the memory configuration and expect this to magically work!

If you wish to use external flash fitted to your board, you need to add its definition and an appropriate flash driver to your memory configuration.

Note that there are a number of FAQs that may provide you with useful assistance here, including:

[list]
  [*]https://www.lpcware.com/content/faq/lpcxpresso/lpc18-lpc43-spifi-flash-drivers
  [*]https://www.lpcware.com/content/faq/lpcxpresso/debugging-lpc18xxlpc43xx-ram-images
[/list]

Regards,
LPCXpresso Support
0 Kudos