Martin Thomas wrote:
> Not enough information. Please give the error-message, create a simple
> example-application and place it somewhere on an internet-server. AFAIK
> some time-functions use a syscall to interface with the hardware,
> sometimes just providing a dummy-syscall is enough to make the linker
> "happy".
The calls I am making are c library calls and are abstract and do not
relate to the hardware. The error messages are
1) undefined reference to `mktime'
2) undefined reference to `gmtime_r'
Martin Thomas wrote:
>
>> 2) If I include the lstdc++ in a pure C project does it create any
>> overhead ?
>
> You can simple try yourself. Create and check the map-file for changes
> after make clean all with an without the c++ library-option. When using
> makefiles based on the WinARM-template (which is based on the
> WinAVR-template) the summary of the memory-usage is part of the output
> of make all.
I must admit I find the map file very hard to read. I know librarys do
not normally increase the size code where no use is made of them, but I
have no idea why the demo's do not include all the librarys so when the
demo's are extended by users it does not "just work" tm ;).
Martin Thomas wrote:
>> 3) The lpc_2129_newlib_cpp_20050820.zip demo has the following in the
>> make file
>> ...
>> Where do I find the ibnewlibc-lpc.a in the Winarm package ?
>
> Suggestion: Find it by searching for the file-name.
> Start->Search->Files->search in c:\WinARM, seach for libnewlib-lpc.a
> (==>arm-elf/lib/). You might want to read the readme.file for WinARM
> 3/06 even if you are using an older version. The location of the library
> is mentioned two times in this readme since it has been a FAQ. (I wonder
> how many people do not know about the file-search function in Windows).
>
> Martin Thomas
I would be surprised too if a programmer did not know about this, I
certainly do and I did search for this library, and it was not there. I
even did it from a command propmt.
Here is my output :-
C:\WinARM>dir *.a /s
Volume in drive C has no label.
Volume Serial Number is 8016-5CBD
Directory of C:\WinARM\arm-elf\lib
14/01/2006 02:03 538,554 libc.a
14/01/2006 02:03 538,554 libg.a
14/01/2006 04:32 557,648 libiberty.a
14/01/2006 02:03 343,992 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,102 librdimon.a
14/01/2006 02:04 24,644 librdpmon.a
14/01/2006 04:25 4,666,504 libstdc++.a
14/01/2006 04:25 315,766 libsupc++.a
9 File(s) 7,035,982 bytes
Directory of C:\WinARM\arm-elf\lib\be
14/01/2006 02:03 536,734 libc.a
14/01/2006 02:03 536,734 libg.a
14/01/2006 04:32 557,832 libiberty.a
14/01/2006 02:03 344,328 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,118 librdimon.a
14/01/2006 02:04 24,652 librdpmon.a
14/01/2006 04:26 4,668,202 libstdc++.a
14/01/2006 04:26 316,216 libsupc++.a
9 File(s) 7,035,034 bytes
Directory of C:\WinARM\arm-elf\lib\be\fpu
14/01/2006 02:03 531,696 libc.a
14/01/2006 02:03 531,696 libg.a
14/01/2006 04:32 556,924 libiberty.a
14/01/2006 02:03 264,040 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,126 librdimon.a
14/01/2006 02:04 24,660 librdpmon.a
14/01/2006 04:29 4,685,580 libstdc++.a
14/01/2006 04:29 317,342 libsupc++.a
9 File(s) 6,962,282 bytes
Directory of C:\WinARM\arm-elf\lib\be\fpu\interwork
14/01/2006 02:04 533,964 libc.a
14/01/2006 02:04 533,964 libg.a
14/01/2006 04:32 559,160 libiberty.a
14/01/2006 02:04 264,504 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,166 librdimon.a
14/01/2006 02:04 24,804 librdpmon.a
14/01/2006 04:30 4,699,738 libstdc++.a
14/01/2006 04:30 319,280 libsupc++.a
9 File(s) 6,985,798 bytes
Directory of C:\WinARM\arm-elf\lib\be\fpu\nofmult
14/01/2006 02:04 537,720 libc.a
14/01/2006 02:04 537,720 libg.a
14/01/2006 04:32 556,688 libiberty.a
14/01/2006 02:04 264,302 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,150 librdimon.a
14/01/2006 02:04 24,696 librdpmon.a
14/01/2006 04:30 4,708,422 libstdc++.a
14/01/2006 04:30 318,632 libsupc++.a
9 File(s) 6,998,548 bytes
Directory of C:\WinARM\arm-elf\lib\be\interwork
14/01/2006 02:04 539,022 libc.a
14/01/2006 02:04 539,022 libg.a
14/01/2006 04:32 560,104 libiberty.a
14/01/2006 02:04 344,836 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,150 librdimon.a
14/01/2006 02:04 24,788 librdpmon.a
14/01/2006 04:29 4,682,368 libstdc++.a
14/01/2006 04:29 318,134 libsupc++.a
9 File(s) 7,058,642 bytes
Directory of C:\WinARM\arm-elf\lib\be\nofmult
14/01/2006 02:04 542,970 libc.a
14/01/2006 02:04 542,970 libg.a
14/01/2006 04:32 557,496 libiberty.a
14/01/2006 02:04 344,456 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,142 librdimon.a
14/01/2006 02:04 24,688 librdpmon.a
14/01/2006 04:29 4,689,076 libstdc++.a
14/01/2006 04:29 317,410 libsupc++.a
9 File(s) 7,069,426 bytes
Directory of C:\WinARM\arm-elf\lib\fpu
14/01/2006 02:03 533,604 libc.a
14/01/2006 02:03 533,604 libg.a
14/01/2006 04:32 556,872 libiberty.a
14/01/2006 02:03 264,020 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,118 librdimon.a
14/01/2006 02:04 24,660 librdpmon.a
14/01/2006 04:27 4,683,890 libstdc++.a
14/01/2006 04:27 316,904 libsupc++.a
9 File(s) 6,963,890 bytes
Directory of C:\WinARM\arm-elf\lib\fpu\interwork
14/01/2006 02:03 535,872 libc.a
14/01/2006 02:03 535,872 libg.a
14/01/2006 04:32 559,052 libiberty.a
14/01/2006 02:03 264,484 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,150 librdimon.a
14/01/2006 02:04 24,788 librdpmon.a
14/01/2006 04:28 4,698,052 libstdc++.a
14/01/2006 04:28 318,834 libsupc++.a
9 File(s) 6,987,322 bytes
Directory of C:\WinARM\arm-elf\lib\fpu\nofmult
14/01/2006 02:03 539,860 libc.a
14/01/2006 02:03 539,860 libg.a
14/01/2006 04:32 556,568 libiberty.a
14/01/2006 02:03 264,282 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,142 librdimon.a
14/01/2006 02:04 24,696 librdpmon.a
14/01/2006 04:28 4,706,280 libstdc++.a
14/01/2006 04:28 318,182 libsupc++.a
9 File(s) 7,000,088 bytes
Directory of C:\WinARM\arm-elf\lib\interwork
14/01/2006 02:03 540,842 libc.a
14/01/2006 02:03 540,842 libg.a
14/01/2006 04:32 559,928 libiberty.a
14/01/2006 02:03 344,500 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,142 librdimon.a
14/01/2006 02:04 24,780 librdpmon.a
14/01/2006 04:27 4,680,694 libstdc++.a
14/01/2006 04:27 317,692 libsupc++.a
9 File(s) 7,059,638 bytes
Directory of C:\WinARM\arm-elf\lib\nofmult
14/01/2006 02:03 545,014 libc.a
14/01/2006 02:03 545,014 libg.a
14/01/2006 04:32 557,344 libiberty.a
14/01/2006 02:03 344,116 libm.a
14/01/2006 02:04 22,218 libnosys.a
14/01/2006 02:04 28,126 librdimon.a
14/01/2006 02:04 24,680 librdpmon.a
14/01/2006 04:27 4,686,974 libstdc++.a
14/01/2006 04:27 316,976 libsupc++.a
9 File(s) 7,070,462 bytes
Directory of C:\WinARM\arm-elf\lib\thumb
14/01/2006 02:03 503,356 libc.a
14/01/2006 02:03 503,356 libg.a
14/01/2006 04:32 553,960 libiberty.a
14/01/2006 02:03 309,536 libm.a
14/01/2006 02:04 22,084 libnosys.a
14/01/2006 02:04 28,126 librdimon.a
14/01/2006 02:04 24,716 librdpmon.a
14/01/2006 04:26 4,951,170 libstdc++.a
14/01/2006 04:26 317,476 libsupc++.a
9 File(s) 7,213,780 bytes
Directory of C:\WinARM\arm-elf\lib\thumb\be
14/01/2006 02:04 502,404 libc.a
14/01/2006 02:04 502,404 libg.a
14/01/2006 04:32 554,536 libiberty.a
14/01/2006 02:04 309,756 libm.a
14/01/2006 02:04 22,084 libnosys.a
14/01/2006 02:04 28,142 librdimon.a
14/01/2006 02:04 24,732 librdpmon.a
14/01/2006 04:31 4,950,480 libstdc++.a
14/01/2006 04:30 317,894 libsupc++.a
9 File(s) 7,212,432 bytes
Directory of C:\WinARM\arm-elf\lib\thumb\be\interwork
14/01/2006 02:04 504,220 libc.a
14/01/2006 02:04 504,220 libg.a
14/01/2006 04:32 556,388 libiberty.a
14/01/2006 02:04 310,544 libm.a
14/01/2006 02:04 22,084 libnosys.a
14/01/2006 02:04 28,166 librdimon.a
14/01/2006 02:04 24,844 librdpmon.a
14/01/2006 04:31 4,958,662 libstdc++.a
14/01/2006 04:31 319,304 libsupc++.a
9 File(s) 7,228,432 bytes
Directory of C:\WinARM\arm-elf\lib\thumb\interwork
14/01/2006 02:04 505,168 libc.a
14/01/2006 02:04 505,168 libg.a
14/01/2006 04:32 555,844 libiberty.a
14/01/2006 02:04 310,324 libm.a
14/01/2006 02:04 22,084 libnosys.a
14/01/2006 02:04 28,150 librdimon.a
14/01/2006 02:04 24,832 librdpmon.a
14/01/2006 04:31 4,959,372 libstdc++.a
14/01/2006 04:31 318,902 libsupc++.a
9 File(s) 7,229,844 bytes
Directory of C:\WinARM\lib
14/01/2006 04:25 1,008,642 libiberty.a
1 File(s) 1,008,642 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2
14/01/2006 04:24 318,650 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
14/01/2006 04:45 30,640 libnewlib-lpc.a
3 File(s) 368,726 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be
14/01/2006 04:24 317,986 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 337,422 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\fpu
14/01/2006 04:24 310,574 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 330,010 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\fpu\interwork
14/01/2006 04:24 310,894 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 330,330 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\fpu\interwork\under
12/01/2006 20:30 318,922 libgcc.a
12/01/2006 20:30 19,404 libgcov.a
2 File(s) 338,326 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\fpu\nofmult
14/01/2006 04:24 302,820 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 322,256 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\interwork
14/01/2006 04:24 318,350 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 337,786 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\be\nofmult
14/01/2006 04:24 310,240 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 329,676 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\fpu
14/01/2006 04:24 311,126 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 330,562 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\fpu\interwork
14/01/2006 04:24 311,434 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 330,870 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\fpu\nofmult
14/01/2006 04:24 303,180 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 322,616 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\interwork
14/01/2006 04:24 319,002 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 338,438 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\nofmult
14/01/2006 04:24 310,708 libgcc.a
14/01/2006 04:24 19,436 libgcov.a
2 File(s) 330,144 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\thumb
14/01/2006 04:24 327,446 libgcc.a
14/01/2006 04:24 19,576 libgcov.a
2 File(s) 347,022 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\thumb\be
14/01/2006 04:24 327,558 libgcc.a
14/01/2006 04:24 19,576 libgcov.a
2 File(s) 347,134 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\thumb\be\interwork
14/01/2006 04:24 323,962 libgcc.a
14/01/2006 04:24 19,576 libgcov.a
2 File(s) 343,538 bytes
Directory of C:\WinARM\lib\gcc\arm-elf\4.0.2\thumb\interwork
14/01/2006 04:24 323,858 libgcc.a
14/01/2006 04:24 19,576 libgcov.a
2 File(s) 343,434 bytes
Directory of C:\WinARM\utils\insight_gdb_6_4_50\lib
19/11/2005 04:46 267,408 libarm-elf-sim.a
19/11/2005 04:46 203,940 libiberty.a
19/11/2005 04:46 858 libitclstub32.a
19/11/2005 04:46 746 libitkstub32.a
19/11/2005 04:46 491,868 libpsp-sim.a
19/11/2005 04:46 552,724 libtcl84.a
19/11/2005 04:46 1,102 libtclstub84.a
19/11/2005 04:46 490,984 libtk84.a
19/11/2005 04:46 2,266 libtkstub84.a
9 File(s) 2,011,896 bytes
Total Files Listed:
189 File(s) 121,860,428 bytes
0 Dir(s) 58,793,361,408 bytes free
C:\WinARM>
Clifford Slocombe Wrote :
> You have commented out the version of LIBS that links libgcc.a - why
> would you do that?
I did that because it could not find the library.
Here is my code :-
// Access methods to read and write the LPC Clock in unix time !
// The clock does not run until it is first set
#define _REENT_ONLY
#include <time.h>
#include "lpc2103.h"
//struct tm
//{
// int tm_sec;
// int tm_min;
// int tm_hour;
// int tm_mday;
// int tm_mon;
// int tm_year;
// int tm_wday;
// int tm_yday;
// int tm_isdst;
//};
void init_clock(void)
{
RTC_CIIR = 0; // No ints
RTC_ALYEAR = 0xFFF; // Disable Alarm feature !!!
RTC_AMR = 0;
if (RTC_CCR != 0x11)
{
RTC_CCR = 0x2; // Hold the clock in reset until it gets a
good time
}
}
time_t get_time_low(void)
{
struct tm stim;
stim.tm_sec = RTC_SEC;
stim.tm_min = RTC_MIN;
stim.tm_hour = RTC_HOUR;
stim.tm_mday = RTC_DOM;
stim.tm_mon = RTC_MONTH;
stim.tm_year = RTC_YEAR;
stim.tm_wday = RTC_DOW;
stim.tm_yday = RTC_DOY;
stim.tm_isdst = 0;
return mktime(&stim);
}
time_t get_time(void)
{
time_t result;
do
{
result = get_time_low();
}
while (result != get_time_low());
return result;
}
void set_time(time_t time_in)
{
struct tm stim;
gmtime_r(&time_in, &stim);
RTC_CCR = 0x2; // Reset the clock
RTC_SEC = stim.tm_sec;
RTC_MIN = stim.tm_min;
RTC_HOUR = stim.tm_hour;
RTC_DOM = stim.tm_mday;
RTC_MONTH = stim.tm_mon;
RTC_YEAR = stim.tm_year;
RTC_DOW = stim.tm_wday;
RTC_DOY = stim.tm_yday;
RTC_CCR = 0x11; // Switch on the clock !!
}
Thanks for your replys so far and thanks again for the WinARM package.