Unable to use run printf("Hello World")

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

Unable to use run printf("Hello World")

807件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by timblu on Tue Sep 23 00:06:31 MST 2014
Hi

I am a newbie. I have recently gotten an LPC Link2 as an evaluation board for the 4370.
I am using LPCXpresso and used Create New C Project(Semi Host). In the main.c, there is already a printf("Hello World"). However, when I debug the code, it is not printed to the console. Instead I get an new page that says: No source available for "0x140003aa".  This address appears differently every time I debug the code.

I have tried to run ledblinky4370 and it works perfectly. However it will not if I insert a printf() in the code.

Please help. Thank you.
ラベル(1)
0 件の賞賛
返信
4 返答(返信)

764件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by timblu on Tue Sep 23 05:54:13 MST 2014
Thank you so much for the help! (:
0 件の賞賛
返信

764件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Sep 23 04:43:51 MST 2014
1. ledblinky4370
a. this project does not build as you have the C library set to Redlb (none). The library needs to be set to Redlib (Semihosting)
b. I see you have configured the project to use the 1Mb of external flash. In which case the Reset script needs to be
LPC18LPC43ExternalFLASHBootResetscript.scp

After making these changes, ledblink4370 prints Hello World on the console

2. testprint
a. This project is configured to use internal RAM (not the external flash). In which case the Reset script needs to be LPC18LPC43RamReset.scp

After making this change, testprint prints Hello World on the console

These are quite complex devices, so I recommend that you read the LPC18/LPC43 FAQs, including:
http://www.lpcware.com/content/faq/lpcxpresso/lpc18-lpc43-support
http://www.lpcware.com/content/faq/lpcxpresso/lpc18-lpc43-external-flash-drivers
0 件の賞賛
返信

764件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by timblu on Tue Sep 23 04:02:26 MST 2014
I am using 2 LPC-Link2. One as an evaluation board for 4370 and one as a debugger probe. Only the Link-2 acting as the debugger is connected to my PC. JP2 is connected on the debugger and the target is not connected to any PC or power source.

I have tried changing the scripts and the "semihosting support" is set to On but it still does not work. Ledblinky4370 builds with an error if printf() is inserted into the main loop. testprint is able to debug but console does not show "Hello World".

Both projects that attempt to print are exported and posted.
0 件の賞賛
返信

764件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Sep 23 01:36:58 MST 2014
The LPC4370 is a flashless part. If you are trying to download and run your code from RAM and you are using LPC-Link2 as the debug adapter, you need to make sure you are using the correct Ram Reset script:
[list]
  [*]Right-click on your project, select Launch configurations->Edit current
  [*]Switch to the Debugger tab
  [*]Find the "Reset Script" Configuration option end edit it
  [*]Enter LPC18LPC43RamReset.scp
[/list]

For semihosting support, you need to make sure that this is enabled in the debug driver. Make sure that the Configuration Option "Semihosting support" is set to On or Auto.

Now try debugging again.

If this does not work, please Export and post your project(s).
0 件の賞賛
返信