2010-02-10 17:48:27 sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85930
Hello everybody,
I'm using a software that makes a spread use of sprintf() function.
I have to cross-compile it on uclinux with bfin-uclinux-gcc toolchain and my target is ADSP-BF 526.
I'm wondering if I can use that or if the functions of stdlib.h / stdio.h are too "heavy" to be implemented on a blackfin!
Thanks for your help!
Cristiana
TranslateQuoteReplyEditDelete
2010-02-10 18:06:59 Re: sprintf on blackfin
Mike Frysinger (UNITED STATES)
Message: 85931
it (and just about every other C library function) should work fine. why would you think it wouldnt work ?
QuoteReplyEditDelete
2010-02-10 18:14:47 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85932
Because I have some problem to port my code on blackfin even if I can cross-compile with no errors...
So I believed that could be the problem...
TranslateQuoteReplyEditDelete
2010-02-10 18:20:31 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85933
And so also functions as fopen() and fclose() can work properly?
TranslateQuoteReplyEditDelete
2010-02-10 18:38:00 Re: sprintf on blackfin
Mike Frysinger (UNITED STATES)
Message: 85934
as i said, all these standard C library functions are known to work just fine. if you have a problem, you have to post real details instead of asking these kinds of questions.
QuoteReplyEditDelete
2010-02-10 19:29:25 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85935
I'm sorry!
Anyway my problem is when I run my software on Blackfin it try to start but it is not able to find some VIDEO_PALETTE.
The software works in the following way:
at the very beginning it open VIDEO0 to communicate with webcam;
then check if it has the video palette it needs for handle snapshot is takes from webcam either periodically or after motion-detection.
It fails because it's not able to find video palette!
I'm sure I have the correct libjpeg library (libjpeg.so.62) because I've compiled that separately and then add in the path of blackdfin.
I'm not sure I has been clear enough, anyway if you have any kind of suggestions they'll be the welcome
thanks!!
TranslateQuoteReplyEditDelete
2010-02-10 23:46:57 Re: sprintf on blackfin
Mike Frysinger (UNITED STATES)
Message: 85938
missing/incompatible/whatever video palettes has nothing to do with standard C library functions
QuoteReplyEditDelete
2010-02-11 02:58:53 Re: sprintf on blackfin
Michael Hennerich (GERMANY)
Message: 85942 Cristiana,
In a different thread about your v4l problem, there error also errored due to some MAP_FAILED.
[1] Supported palettes:
[1] Unable to find a compatible palette format.
[1] MAP_FAILED: No such device
You might need to make the drivers and app MMAP function to use MAP_PRIVATE, instead of MAP_SHARED.
-Michael
QuoteReplyEditDelete
2010-02-11 14:29:48 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85991
Thank you!
That's something I didn't think!
How can I use MAP_PRIVATE? what is the differences between them?
Thanks!
Cristiana
TranslateQuoteReplyEditDelete
2010-02-11 14:59:56 Re: sprintf on blackfin
Robin Getz (UNITED STATES)
Message: 85992
Cristiana:
check "man mmap".
-Robin
QuoteReplyEditDelete
2010-02-11 15:28:25 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85993
Ok I see.
Do you know if I have to modify my software OR something during cross-compilation (or in the kernel) ?
TranslateQuoteReplyEditDelete
2010-02-11 15:40:13 Re: sprintf on blackfin
Michael Hennerich (GERMANY)
Message: 85994 In case it’s a MMAP issue you need to patch the driver and your user space app to use MAP_PRIVATE
Here is a example I used for some uvc usb cam driver some time ago.
You can find similar patches relevant to the NOMMU MMAP in some video apps such as ffmpeg.
QuoteReplyEditDelete
2010-02-11 15:43:07 Re: sprintf on blackfin
Robin Getz (UNITED STATES)
Message: 85995
Chistiana:
It something that you need to do in your source - not the kernel.
It has been done to all the libs/packages in the uClinux-dist already.
-Robin
QuoteReplyEditDelete
2010-02-11 17:26:48 Re: sprintf on blackfin
cristiana tenti (UNITED STATES)
Message: 85997
Thank you everybody for your helps!
In my software I have this call:
s->buffers[b].ptr = mmap(NULL, buf.length, PROT_READ | PROT_WRITE, MAP_SHARED, s->fd, buf.m.offset);
if (s->buffers[b].ptr == MAP_FAILED) {
motion_log(LOG_ERR, 1, "Error mapping buffer %i mmap", b);
free(s->buffers);
return -1;
}
Is it possible that it's my problem?
I understood that I've to change the parameter MAP_SHARED in MAP_PRIVATE, but I also read the uClinux dosen't have a mmu, so this call is unproperly?