ppisa commented on issue #15966:
URL: https://github.com/apache/nuttx/issues/15966#issuecomment-2711682853

   
   NuttX allows to select multiple option for math library (LIBM) and 
availability of thee options depends on the actual target and used toolchain. I 
expect that you have used `./tools/configure.sh raspberrypi-pico-w:nsh`  for 
configuration. This configuration does not specify exact LIBM   and Kconfig 
default choice is `LIBM_TOOLCHAIN` , see 
[libs/libm/Kconfig](https://github.com/apache/nuttx/blob/master/libs/libm/Kconfig)
 which is usually the best matching and the most performant library. You do not 
write which toolchain have you used. On Linux distribution, you usually need to 
install NewLib or its nano, pico variants separately. I ma not sure how it 
should be done in the specific case, I have usually my own toolchains setups 
and their customization.
   
   The problem can be resolved for the most architectures to switch to NuttX 
provided LIBM, it can be suboptimal, but it is present directly in NuttX 
sources. Run `make menuconfig` or `make qconfig` and select  
   
   - Math library from NuttX (`LIBM`)
   
   in
   ```
   "Library Routines" -> "Standard C Library Options"
   ```
   The other options are
    
   - Math library from toolchain (`LIBM_TOOLCHAIN`)
   - Math library from Newlib (`LIBM_NEWLIB`)
   - No math library (`LIBM_NONE`)
   - Math library from openlibm (`LIBM_OPENLIBM`)
   
   It would worth to add some suggestion about toolchain to use into given 
platform page in the manual.
   
   May it be it should go into common RaspberryPi rp2040 [install 
section](https://nuttx.apache.org/docs/latest/platforms/arm/rp2040/index.html#installation)
 and use of the internal LIBM shoudl be mentioned as workaround. It could be 
quite slow because RPi1 Cortex-M0+ processor is quite obscure and performance 
can be used by some integer math accelerator peripherals and if float and 
double support functions can be written with its existence in mind, may it be 
even in assembly, than it can be much faster in some SD specific library... 
   
   The corresponding document source (where some clarification can be added) is 
[Documentation/platforms/arm/rp2040](https://github.com/apache/nuttx/tree/master/Documentation/platforms/arm/rp2040).
 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to