Skip to content

Commit

Permalink
samples: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Browse files Browse the repository at this point in the history
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF and adjust
CONFIG_LIBC_MALLOC_ARENA_SIZE as needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard authored and aescolar committed Oct 25, 2023
1 parent 565c937 commit 1e5c46d
Show file tree
Hide file tree
Showing 73 changed files with 104 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
# LC3 lib requires floating point support in the c-lib NEWLIB is one way of getting that.
CONFIG_NEWLIB_LIBC=y
# LC3 lib requires floating point support in the c-lib.
CONFIG_REQUIRES_FULL_LIBC=y
4 changes: 2 additions & 2 deletions samples/boards/nrf/clock_skew/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG_COUNTER=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
3 changes: 2 additions & 1 deletion samples/compression/lz4/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_LZ4=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=65536
2 changes: 1 addition & 1 deletion samples/compression/lz4/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ common:
- compression
- lz4
min_ram: 64
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED
harness: console
harness_config:
type: one_line
Expand Down
2 changes: 1 addition & 1 deletion samples/drivers/counter/maxim_ds3231/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_COUNTER_MAXIM_DS3231=y
CONFIG_COUNTER_INIT_PRIORITY=65

# Minimal libc doesn't have strftime()
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

# Optional step that syncs RTC and local clock. Don't enable this if
# your RTC has already been synchronized and you want to keep its
Expand Down
2 changes: 1 addition & 1 deletion samples/drivers/counter/maxim_ds3231/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED
sample:
name: Maxim DS3231 RTC
tests:
Expand Down
2 changes: 1 addition & 1 deletion samples/modules/tflite-micro/hello_world/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TensorFlow, you must enable the below Kconfig options in your :file:`prj.conf`:
.. code-block:: kconfig
CONFIG_CPP=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_TENSORFLOW_LITE_MICRO=y
Note that the CMSIS-NN kernel sample demonstrates how to use CMSIS-NN optimized kernels with
Expand Down
2 changes: 1 addition & 1 deletion samples/modules/tflite-micro/hello_world/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tests:
integration_platforms:
- qemu_x86
tags: tensorflow
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED
sample.tensorflow.helloworld.cmsis_nn:
tags: tensorflow
platform_allow: mps3_an547
Expand Down
2 changes: 1 addition & 1 deletion samples/modules/tflite-micro/magic_wand/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TensorFlow, you must enable the below Kconfig options in your :file:`prj.conf`:
.. code-block:: kconfig
CONFIG_CPP=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_TENSORFLOW_LITE_MICRO=y
Training
Expand Down
2 changes: 1 addition & 1 deletion samples/modules/tflite-micro/magic_wand/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ==============================================================================
CONFIG_CPP=y
CONFIG_STD_CPP17=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_SENSOR=y
CONFIG_NETWORKING=n
CONFIG_MAIN_STACK_SIZE=4096
Expand Down
2 changes: 1 addition & 1 deletion samples/net/cloud/aws_iot_mqtt/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_INIT_STACKS=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_SNTP=y
CONFIG_JSON_LIBRARY=y
CONFIG_POSIX_CLOCK=y
Expand Down
2 changes: 1 addition & 1 deletion samples/net/cloud/aws_iot_mqtt/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sample:
common:
tags: net mqtt cloud
harness: net
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED && !CONFIG_NATIVE_LIBC
extra_args: USE_DUMMY_CREDS=1
tests:
sample.net.cloud.aws_iot_mqtt:
Expand Down
2 changes: 1 addition & 1 deletion samples/net/cloud/mqtt_azure/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CONFIG_DNS_RESOLVER=y
CONFIG_DNS_SERVER_IP_ADDRESSES=y
CONFIG_DNS_SERVER1="8.8.8.8"
CONFIG_DNS_RESOLVER_ADDITIONAL_BUF_CTR=2
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

CONFIG_INIT_STACKS=y
CONFIG_NET_SHELL=y
Expand Down
2 changes: 1 addition & 1 deletion samples/net/cloud/mqtt_azure/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED
sample:
description: MQTT sample app to Azure cloud
name: mqtt-azure
Expand Down
2 changes: 1 addition & 1 deletion samples/net/dsa/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CONFIG_NET_TC_TX_COUNT=6
CONFIG_NET_TC_RX_COUNT=4
CONFIG_NET_CONFIG_INIT_TIMEOUT=10

CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

CONFIG_NET_IF_MAX_IPV4_COUNT=4
CONFIG_NET_IF_MAX_IPV6_COUNT=4
Expand Down
4 changes: 2 additions & 2 deletions samples/net/gptp/boards/mimxrt1050_evk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ CONFIG_ETH_MCUX_PTP_CLOCK_SRC_HZ=25000000
CONFIG_ETH_MCUX_RX_BUFFERS=6
CONFIG_ETH_MCUX_TX_BUFFERS=4
CONFIG_NET_GPTP_STATISTICS=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
4 changes: 2 additions & 2 deletions samples/net/gptp/boards/mimxrt1060_evk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ CONFIG_NET_GPTP_CLOCK_ACCURACY_25MS=y
#CONFIG_ETH_MCUX_RX_BUFFERS=6
#CONFIG_ETH_MCUX_TX_BUFFERS=8
CONFIG_NET_GPTP_STATISTICS=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_NET_GPTP_INIT_LOG_PDELAY_REQ_ITV=-3
2 changes: 1 addition & 1 deletion samples/net/lwm2m_client/overlay-ot.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Main
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

# Disable TCP and IPv4 (TCP disabled to avoid heavy traffic)
CONFIG_NET_TCP=n
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/big_http_download/prj.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MAIN_STACK_SIZE=2536
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/big_http_download/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sample:
description: BSD Sockets big HTTP download example
name: big_http_download
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
harness: net
min_ram: 32
min_flash: 128
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/coap_client/prj.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generic networking options
CONFIG_NETWORKING=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_NET_IPV6=y
CONFIG_NET_UDP=y

Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/coap_client/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
sample:
description: TBD
name: TBD
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/coap_server/prj.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generic networking options
CONFIG_NETWORKING=y
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_NET_UDP=y

# Socket
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/coap_server/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
sample:
description: TBD
name: TBD
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/dumb_http_server/prj.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

# Networking config
CONFIG_NETWORKING=y
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/dumb_http_server/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sample:
description: BSD Sockets API dumb HTTP server example
name: socket_dumb_http_server
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
harness: net
min_ram: 32
min_flash: 96
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sample:
common:
harness: net
depends_on: netif
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
tests:
sample.net.sockets.echo:
tags:
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_async/prj.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_MAIN_STACK_SIZE=1200

# Networking config
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_async/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sample:
description: BSD Sockets API TCP echo server sample using non-blocking sockets
name: socket_echo_async
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
harness: net
platform_allow: qemu_x86
tags:
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_async_select/prj.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_MAIN_STACK_SIZE=1200
CONFIG_POSIX_API=y

Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_async_select/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ common:
tags:
- net
- socket
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
tests:
sample.net.sockets.echo_async_select:
extra_configs:
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_client/overlay-ot.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

# Disable TCP and IPv4 (TCP disabled to avoid heavy traffic)
CONFIG_NET_TCP=n
Expand Down
6 changes: 3 additions & 3 deletions samples/net/sockets/echo_client/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ tests:
- net
- openthread
platform_allow: nrf52840dk_nrf52840
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
sample.net.sockets.echo_client.b91_802154:
extra_args: OVERLAY_CONFIG="overlay-802154.conf"
platform_allow: tlsr9518adk80d
Expand All @@ -92,15 +92,15 @@ tests:
- net
- openthread
platform_allow: tlsr9518adk80d
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
sample.net.sockets.echo_client.kw41z_openthread:
extra_args: OVERLAY_CONFIG="overlay-ot.conf"
slow: true
tags:
- net
- openthread
platform_allow: frdm_kw41z
filter: TOOLCHAIN_HAS_NEWLIB == 1
filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC
sample.net.sockets.echo_client.userspace:
extra_args:
- CONFIG_USERSPACE=y
Expand Down
2 changes: 1 addition & 1 deletion samples/net/sockets/echo_server/overlay-ot.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_NEWLIB_LIBC=y
CONFIG_REQUIRES_FULL_LIBC=y

# Disable TCP and IPv4 (TCP disabled to avoid heavy traffic)
CONFIG_NET_TCP=n
Expand Down
Loading

0 comments on commit 1e5c46d

Please sign in to comment.