Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1
Send Topic Print
Newlib and softfloat (Read 3095 times)
Pibben
YaBB Newbies
*




Posts: 17
Newlib and softfloat
04/25/08 at 8:02am
 
Is is possible to use some c-lib, preferably newlib, with the current GCC-toolchain? How?
 
Does it support some kind of "softfloat" (floating point emulation routines)?
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Newlib and softfloat
Reply #1 - 04/25/08 at 8:38am
 
It is certainly possible.  However, early in the development of the SRV-1 firmware, we ran into linking problems with newlib, probably due to an issue with the toolchain version, and rather than trying to sort out the library, decided instead to write our own C lib functions to make the codebase completely self-contained.  
 
Whether or not this was a smart approach can be debated, but the goal with the "bare metal" firmware has been to keep the code small enough to completely fit in L1 memory, so 100% control of the libraries seems consistent with that goal.  Our assumption is that users who want full C library support and ability to run larger applications will probably end up using the uClinux port.
 
As regards running floating point with the "bare metal" firmware, there is an optimized floating point library for the Blackfin, as discussed here -
    http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1207762206
 
I haven't looked closely at this code, but generally have found that it is not difficult to move ASM code written for Analog's VDSP environment over to the bfin-elf-gcc environment.
 
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pibben
YaBB Newbies
*




Posts: 17
Re: Newlib and softfloat
Reply #2 - 04/28/08 at 12:00am
 
Thanks for you reply. Do I have to change the "bare metal" setup and/or toolchain to be able to use application larger than 64kb?
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Newlib and softfloat
Reply #3 - 04/28/08 at 6:50am
 
That is a good question for which I don't have an answer, but I'll ask Martin of section5.ch for his comments.
 
My guess is that there is a way to configure the loader to run program code from SDRAM.  A more interesting approach might be to use some of the L1 for its intended purpose as a dynamic associative code cache.  Here's a discussion of this technique -  
    http://docs.blackfin.uclinux.org/doku.php?id=cache_management#cache_setup_and_co ntrol
Back to top
 
« Last Edit: 04/28/08 at 6:52am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
icebear
YaBB Newbies
*




Posts: 28
Re: Newlib and softfloat
Reply #4 - 04/28/08 at 8:10am
 
Hello,
 
there's no limit in code size with the bare metal approach -- not from the compiler's side. You can run code directly from SDRAM with the bare metal code - provided, that you have configured the SDRAM controller (EBIU) correctly. However, as Howard implied, it will run slow without cache.
 
If you can waste a few 100k, I'd recommend starting your programs from u-boot. That already does a lot of cache configuration and also allows easy updates and flash programming. No more worries about writing lots of bootstrap code, either.
 
For the float issue: The libm and the GCC internal libs for Blackfin take care of that, if you use floats in your code, the FPU emulation will be silently linked in Smiley
This will of course kill some performance, so if you want to do numerically efficient stuff, you might want to look at all the code using fixed point formats (libbfdsp, etc.)
 
A comment about the newlib: In my opinion this beast is quite bloated and not really nice for embedded stuff. Even using a simple printf would eat up all L1 memory in my little test app, so I went for a somewhat selective approach, rewriting part of the functions. See http://www.section5.ch/forum/viewtopic.php?p=133#133 for a link to the shell.tgz code - it demonstrates how to merge "bare metal" with some basic newlib functionality.
 
Since the standalone support is a bit of an orphaned thing in the uClinux community, you'll get no "perfect" board supply package at this moment, but I guess the shell code should get you going. Just make sure you compile in boards/SRV1.
 
Hope that answers some,
 
- Martin
Back to top
 
 
  IP Logged
Pibben
YaBB Newbies
*




Posts: 17
Re: Newlib and softfloat
Reply #5 - 04/28/08 at 11:51pm
 
> If you can waste a few 100k, I'd recommend starting your programs from u-boot. That already does a lot of cache configuration
> and also allows easy updates and flash programming. No more worries about writing lots of bootstrap code, either.
 
Thanks for the tip! What setups does u-boot do and what do I have to handle in the app? Where can I read about this?
 
Thanks again!
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Newlib and softfloat
Reply #6 - 04/29/08 at 6:37am
 
We originally shipped with u-boot installed, configuring it to automatically load srv1.bin.  The main problem is that u-boot and uClinux are configured by default to run at 57k or 115kbaud, and we really need versions that run at 921k or 2500k so that we can easily switch back and forth between u-boot, uClinux and srv1 firmware all running at the same speed. To accommodate this, hardware flow control specific to the SRV-1 has to be mapped into the u-boot and uClinux serial drivers.  Martin knows about this, and hopefully he will add high-speed serial support before too long, since it's his u-boot and uClinux ports that Analog Devices hosts on their blackfin.uclinux.org distributions.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pages: 1
Send Topic Print