Skip to content

Commit

Permalink
ncs: default to newlibc nano
Browse files Browse the repository at this point in the history
The nano flavour of newlibc used to be the default before NCS v2.2.0.

This changed when the commit in
zephyrproject-rtos/zephyr#51340
was merged downstream, increasing the FLASH size of all nrf9160
samples by about 40KB, due to their requirement on some
variadic C functions whose implementation is much larger
in vanilla newlibc.

This patch reverts the change from upstream and maintains the
newlibc nano flavour as the default for nrf9160 samples,
and all other samples that use newlibc.

Removed decimal point accuracy from cloud codec tests.
The test was introduced while newlibc did not use nano
(and was failing when reintroducing nano).

Signed-off-by: Håvard Vermeer <havard.vermeer@nordicsemi.no>
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
  • Loading branch information
lemrey authored and rlubos committed Nov 25, 2022
1 parent c00fa3a commit f9cecc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ endchoice
config WARN_EXPERIMENTAL
default y

# Zephyr default is newlib and not newlib-nano for consistency between architectures.
# To reduce FLASH footprint, newlib-nano is preferred default in NCS when newlib is selected.
config NEWLIB_LIBC_NANO
default y
depends on NEWLIB_LIBC && HAS_NEWLIB_LIBC_NANO

# This is a temporary solution to whitelist
# BOARD_THINGY91_NRF9160_NS in compliance
config BOARD_THINGY91_NRF9160_NS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ const static struct cloud_data_battery bat_data_example = {
"\"appId\":\"GNSS\","\
"\"messageType\":\"DATA\","\
"\"ts\":1563968747123,"\
"\"data\":{\"lng\":30.03,\"lat\":40.04,\"acc\":180,\"alt\":245,\"spd\":5,\"hdg\":39}"\
"\"data\":{\"lng\":30,\"lat\":40,\"acc\":180,\"alt\":245,\"spd\":5,\"hdg\":39}"\
"}]"

const static struct cloud_data_gnss gnss_data_example = {
.queued = true,
.gnss_ts = 1563968747123,
.pvt = {
.longi = 30.03,
.lat = 40.04,
.longi = 30,
.lat = 40,
.alt = 245,
.acc = 180,
.spd = 5,
Expand Down

0 comments on commit f9cecc6

Please sign in to comment.