Thumb 2 (Lpc1342)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Thumb 2 (Lpc1342)

557件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bhallett on Wed Apr 21 01:48:38 MST 2010
Hello All,

Can anyone direct me to the Thumb 2 instruction set? I am having a hard time finding it.

I need this as my code works fine in debug mode but when I change to release mode (which optimises the code to -02 -Os level in IDE 3.3.4.170) my code stops working.

Also while I am here, I am using the JTAG programmer which comes with the LPCXpresso dev kit to program a LPC1342 target board but, when programming there is a very long delay between the software having reported the flash being programmed and the progress being finished, any clues?


Regards

Barry
0 件の賞賛
10 返答(返信)

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Apr 23 06:58:59 MST 2010

Quote: bhallett

When creating a fresh import of CMSIS and creating a blank compiled Test project it takes ~ 1m 20s from the point of clicking on the Debug option in the Quickstart panel to reaching the break point in main().

When selecting the projects MPU setting do I have to select the MPU setting for CMSIS also?



The MPU settings for each CMSIS library project are suitable for any MCU in the family (eg LPC11, LPC13 or LPC17).


Quote: bhallett

After having re-compiled the test application for the LPCXpresso LPC1343 MPU, the time between pressing the Debug option and reaching the break point in main is <21s.



OK, so if the same code takes <21s to download on the LPCXPresso1343 and about 1m20s to your own board, it sounds like there is probably an issue for the debug/reset circuitry on your board.

I suggest doing a compare and contrast of your schematics with the LPCXpresso ones which can be downloaded from:

  http://ics.nxp.com/support/lpcxpresso/

The following threads also contains some posts which may be of use.

  http://knowledgebase.nxp.com/showthread.php?t=82

Regards,
CodeRedSupport.
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bhallett on Fri Apr 23 00:48:09 MST 2010
Thanks all for your help.

NXP_USA

I have completely isolated the LPC1343 target board by cutting all the tracks between the two set of holes and I have put in a double row header such that I can connect/disconnect all connections with jumper links.

CodeRedSupport

Here are my answers to your questions:

My PC has a specification as follows:

Windows XP Pro with SP3,
Intel Pentium 4 1.70GHz with 1Gb of Ram.

When creating a fresh import of CMSIS and creating a blank compiled Test project it takes ~ 1m 20s from the point of clicking on the Debug option in the Quickstart panel to reaching the break point in main().

When selecting the projects MPU setting do I have to select the MPU setting for CMSIS also?

After having re-compiled the test application for the LPCXpresso LPC1343 MPU, the time between pressing the Debug option and reaching the break point in main is <21s.

NOTE: The Debug process was triggered in both cases having removed and replaced the USB cable first so the USB driver was re-initialised in both cases first.

"Initialise LPC-Link as HID" was unchecked in both cases.

Regards

Barry
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Thu Apr 22 09:03:06 MST 2010
Note- for most applications, separating the LPC-Link debugger from the LPC1xxx target side is unnecessary. Unless a smaller physical size is needed, it is usually easier to score the traces between the holes and add jumpers to disconnect the target. This makes it possible to use the mini 10-pin debug connecter with other boards. This also makes it easier to re-attach the target or to partially disconnect the target to insert an ammeter for power measurements.

NXP USA Support
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 21 05:23:20 MST 2010
Hi again,

Your MCU debug log shows that your ~7KB of code is getting programmed into the flash in ~8 seconds, which sounds about right for XP, particularly if you are using the hid driver (and it is presumably not a recent, fast PC if it is running XP). So this leaves the question of what is then happening for the remaining 1min 37 seconds!

What should be happening is that the MCU should be coming out of reset and running the initialisation code and then stopping when it hits the breakpoint on main(). But this should only take a second or two to happen at most.

Can you try creating  a new workspace, import the LPC13 CMSIS project from the examples, and then use the Project wizard to create an "NXP LPC1300 C Project". Build this as created, then select Debug. How long does this take to program into flash and execute up to the breakpoint on main() ?

As you are using your own LPC1342 board, I presume that you have split the LPC-Link off from the MCU part of the LPCXpresso board? It would be good to try the same test using the MCU on the LPCXpresso1343 board. Do you have another such board to hand, or can you connect your LPC-Link back to the main MCU part of your LPCXpresso board?

Please make sure you have "Initialise LPC-Link as HID" unticked on your XP box when you do all this. Note that this setting is stored in the workspace, so make sure you check it after creating the new workspace.

Regards
CodeRedSupport
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bhallett on Wed Apr 21 04:21:08 MST 2010
Hi,

Here are my answers:

So what you are saying is that it takes a very long time to hit the automatically breakpoint set at the start of main()? Can you quantify this time period more for us (and what exactly your start and end points for the timing are)?

   To the first sentence, yes that is correct. It takes about 1min 45sec
   to reach the breakpoint.

Can you also tell us how big your program is (as reported at the end of the build step)?

   Last lines in build process:

   text   data    bss    dec    hexfilename
   6836    524    976   8336   2090StandaloneDC.axf

Can you also tell us a little about your startup code. Are you running the CodeRed startup file, and the CMSIS code, unchanged, or have you made modifications?

   I am using CMSIS yes but only my code starts in main() as:

   int main(void)
   {
     CORE_Init();

     TICKER_Init();
       .
       .
       .
       etc

Can you also post the contents of the "MCU Debug Log" available from the little "terminal icon" on the right hand side of the Console view?

   See MCUDebugLog.zip attachment.

Finally, can you go to Window -> Preferences -> LPCXpresso ->Debug and confirm whether the "Initialise LPC-Link as HID" option is ticked or unticked? It should be unticked (by default) for XP. Also what spec is your PC (processor and memory)?

    "Initialise LPC-Link as HID" is checked but it was unchecked by
     default, I checked it to see if it would make any difference,
     I don't think it did but I will try again after your response.

Regards,

Barry
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 21 03:36:57 MST 2010
Hi,

So what you are saying is that it takes a very long time to hit the automatically breakpoint set at the start of main()? Can you quantify this time period more for us (and what exactly your start and end points for the timing are)?

Can you also tell us how big your program is (as reported at the end of the build step)?

Can you also tell us a little about your startup code. Are you running the CodeRed startup file, and the CMSIS code, unchanged, or have you made modifications?

Can you also post the contents of the "MCU Debug Log" available from the little "terminal icon" on the right hand side of the Console view?

Finally, can you go to Window -> Preferences -> LPCXpresso ->Debug and confirm whether the "Initialise LPC-Link as HID" option is ticked or unticked? It should be unticked (by default) for XP. Also what spec is your PC (processor and memory)?

Regards,
CodeRedSupport
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bhallett on Wed Apr 21 03:13:25 MST 2010
Thanks CodeRedSupport :-)

I am downloading the firmware to the device under an XP professional OS using IDE 3.3.4.170. Once I have built a release version of the firmware I am selecting debug from the quickstart menu.

Regards

Barry
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 21 03:07:38 MST 2010
With regards to the Thumb-2 instruction set, I would recommend that you look at:

[LIST]
[*]ARM Architecture v7M Reference manual (registration required)
[/LIST]
[INDENT]http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403c/index.html
[/INDENT]
[LIST]
[*]Technical Reference Manual for Cortex-M3
[/LIST]
[INDENT]http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337h/index.html
[/INDENT]You might also want to take a look at "The Definitive Guide to the ARM Cortex-M3 (2nd edition)" by Joseph Yiu, which is available from your favourite online bookstore.

With regards to why your code no longer works when you move to a release build, it is hard to give a definite answer - but certain one very common issue is that the compiler is now optimising out access to variables which should be declared as volatile, but which have not been.

You might also want to take a look at the following, which includes some information on some of the debug illusion effects you should be aware of when debugging optimised code:

[LIST]
[*]http://lpcxpresso.code-red-tech.com/LPCXpresso/node/26
[/LIST]
With regards to the issue with flash programming, can you give more details of exactly how you are downloading and which OS your PC is running?

Regards,
CodeRedSupport
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bhallett on Wed Apr 21 03:00:15 MST 2010
Thanks for that rkiryanov. I have managed to find the first document to download but i cannot find:

DDI0403C_arm_architecture_v7m_reference_manual_err ata_markup_3_0.pdf

Do you have a link to find it?
0 件の賞賛

526件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Wed Apr 21 02:22:23 MST 2010
Download from arm.com following documents:

DDI0337G_cortex_m3_r2p0_trm.pdf
DDI0403C_arm_architecture_v7m_reference_manual_errata_markup_3_0.pdf
0 件の賞賛