Problem lpc1114 with __write

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

Problem lpc1114 with __write

838 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 01:03:09 MST 2011
Hi,

I have a problem with the adc example when I want to debug, it's seems to be the __write command which is a "undefined reference".

Could bring your help ? Thanks
0 Kudos
18 Replies

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Jul 18 02:39:49 MST 2011

Quote: Aurélien

Could you explain what is that error ?


If you have a new question which is basically unrelated to the original subject of a thread, then please create a new thread - rather than posting in the existing thread!!! Otherwise your new question is quite likely to get missed by other forum members :eek:

Anyway - there is an FAQ on the error "03: Failed on chip setup: Ec(01). Invalid, mismatched, or unknown part" ....

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

Regards,
CodeRedSupport
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Jul 18 00:15:10 MST 2011

Quote: NXP_USA
Our apologies, we have allowed the getting started guide that is posted on the www.nxp.com/lpcxpresso-support web site to become out-of-date.



Which is not too difficult ...
This kind of automatically happens as soon as a new LPCXpresso with new functionallity comes out :eek:
Would it not be much better to just have one Getting Started?
There is already a very good link on the lpcxpresso-support site pointing to the installation of the LPCXpresso tools. Just state that there is a getting started with the product.

This way we are sure that uses always have to correct getting started.
what if you had updated the getting started for LPCXpresso 4 and someone decides to download LPCXpresso 3.6 ...

Regards,

Rob
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Sun Jul 17 23:56:10 MST 2011
Thanks !

Could you explain what is that error ?
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Wed Jul 13 13:49:51 MST 2011
Our apologies, we have allowed the getting started guide that is posted on the www.nxp.com/lpcxpresso-support web site to become out-of-date. It should be updated soon. Until then, you can use the one that is included with LPCXpresso, it is up-to-date.

-NXP
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 13 06:07:58 MST 2011
As mentioned before this example is confusing for beginners :mad:

So the best way to use it is to create a wonderful new LPCXpresso4 semihosting project, copy adc.c and adc.h files to your source, delete a few settings and then modify it :)

This is doable in 30 minutes with a good trainee, a bet and a bottle of beer :eek:

The result is a simple semihosting ADC sample:

[ATTACH]499[/ATTACH]
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Wed Jul 13 05:52:12 MST 2011
How does it works to write the conversion in the console with the example of adc.
Where is the variable which gives this conversion ?
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Jul 12 07:16:00 MST 2011
Read the Getting Started guide that was provided with the product??? :p

There was an option to display this when you first installed, and there is a link directly to it in the Welcome screen that normally displays when you start up the tool, else you can find it within the tools installation.

On my machine for the current version of LPCXpresso 4, this is at
C:\nxp\LPCXpresso_4.0.5_123\lpcxpresso\LPCXpressoGettingStarted.pdf

Regards,
CodeRedSupport
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 07:07:50 MST 2011
Ok when I cleaned and then close the IDE. After openning it appears this error dissappeared. Waouuh !!:eek:

But could explain to me how to create the .axf ?
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 07:03:48 MST 2011
In fact, I try to mix the adc example with the lighting led but I created a new project to do that.

So I followed intructions in getting started but the commands are not the same for LPCXpresso 4.0.5.

http://ics.nxp.com/support/documents/microcontrollers/pdf/lpcxpresso.getting.started.pdf

In part 6.6.2
Create the ‘Skeleton’ project, I don't have 'MCU project wizards’ and “Create NXP Project".
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Jul 12 06:55:49 MST 2011
Curious. Can you do a full clean of the projects in your workspace (including any library projects), then try building again. Do you still see the error ?

Regards,
CodeRedSupport.
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 12 06:53:00 MST 2011
Obviously you are not using the working ADC sample in

...\LPCXpresso_4.0.5_123\lpcxpresso\Examples\NXP\LPC1000\LPC11xx\NXP_LPCXpresso1114-302_2011-02-07.zip

or you have changed relevant settings :confused:
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 06:44:54 MST 2011
Yes my projet was on Redlib(none).
I changed to Redlib(semihost)

But I have a new error.

BFD (Red Suite 2010Q4 by Code Red) 2.20.51.20100809 assertion fail /var/code_red/builds/GNU/2010_100B/build/obj/binutils-src-2010.09-51-arm-none-eabi-i686-mingw32/bfd/elf32-arm.c:13370   
make: *** [libproject.axf] Error 1

Maybe due to the *.axf which is not created.
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Jul 12 05:36:41 MST 2011
I suspect that you project is not set up to be semihosted, which means that the appropriate library code that implements __sys_write (__write) is not available to be linked in.

Switch your project to Redlib(Semihost)....
http://support.code-red-tech.com/CodeRedWiki/SwitchingCLibrary

[I]Aside with reference to Zero's comments[/I] - Redlib_v2 does actually make the symbol __write available as an alias to  __sys_write. This should help to prevent link problems when you are  trying to call the semihosting output function from your code, but will  not prevent link issues if you try to retarget printf to write out  through a UART. More info in...

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

Regards,
CodeRedSupport
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 12 05:12:14 MST 2011
OMG,

that's one of the confusing NXP samples :eek:

Could you post your build log with your error message?
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 04:56:15 MST 2011
No I haven't. It works in adc example without stdio.h.

I use :
<stdarg.h>
<stdint.h>
"debug_printf.h"
"small_printf.h"
"small_utils.h"
"LPC11xx.h"
"driver_config.h".
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 12 04:29:29 MST 2011
Are you including "stdio.h" ?

Which library are you using?

http://support.code-red-tech.com/CodeRedWiki/UsingPrintf
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Aurélien on Tue Jul 12 04:16:59 MST 2011
I put __sys_write but the problem still existing.
0 Kudos

701 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 12 01:23:46 MST 2011
Since LPCXpresso4 you have to use [FONT=Courier New]__sys_write()[/FONT] :eek:

http://support.code-red-tech.com/CodeRedWiki/UartPrintf?highlight=%28%5C_%5C_write%29


Quote:

To do this, you need to provide your own implementations of the function [B]__write[/B]() (Red Suite / LPCXpresso 3.6 and earlier) or __sys_write() (later versions).

0 Kudos