Commit graph

90 commits

Author SHA1 Message Date
Kumar Gala 6b8fa2a85e arm: nxp: kinetis: Remove explicity setting of pincfg to GPIO
Remove board code and a few associated samples/tests that explicitly
call pinmux_pin_set() to set a given pin as GPIO.  This is handled as
part of gpio_mcux_configure() so we don't need to do it again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-15 12:25:05 +02:00
Peter Bigot 188cb2cb7c net: Conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-14 07:07:40 -04:00
Flavio Ceolin 9fd4ea91b7 coccinelle: Remove extra semicolon
coccicheck --mode=patch --cocci=semicolon.cocci

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-25 11:35:30 -05:00
Kumar Gala 942916e691 arm: nxp: kinetis: Rework device_get_binding for pinmux
Switch to use DEVICE_DT_GET instead of device_get_binding for pinmux
device.  As part of this change drop the "label" property from
the pinmux devicetree node and update the binding and dts files to
reflect that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-16 16:45:02 -06:00
Krzysztof Chruscinski 7f08061f0c logging: Revamp menuconfig
Clean up logging menuconfig by grouping configuration into
sections like: mode, processing configuration, backends.

Additionlly, removed LOG_ENABLE_FANCY_OUTPUT_FORMATTING which is no
longer in use.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-26 06:15:42 -05:00
Kumar Gala b1e4913a8a boards: arm: nxp: kinetis: Convert pinmux to new DT based names
Convert board pinmux code to utilize pinmux port information from
devicetree and not Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:52:52 -06:00
Anas Nashif bf4ce568ab sample: tagoio_http_post: add net harness to testsuite
This sample can't be tested on HW without having a network setup.

Fixes #30476

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-16 12:49:58 -05:00
Watson Zeng 7a3f9c4e39 tests: add filter for some tests using newlib
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-12-16 08:57:40 -05:00
Gerson Fernando Budke bc4361db0d samples: net: cloud: tagoio_http_post: Fix sample name
The current name Socket TagoIO HTTP Client still refering to directory
samples/net/sockets.  Rename to TagoIO IoT Cloud HTTP Sample to reflect
better the application sample intention.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-24 23:41:25 -05:00
Gerson Fernando Budke 822070d8c6 samples: net: cloud: tagoio_http_post: Force pinmux config
There are some hardware combinations (board/shields) that report the
error undefined initialization levels used at link phase.  Add pinmux
Kconfig at project configuration to fix the issue.

Fixes #30029.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-24 23:41:25 -05:00
Peter Bigot 56048bb500 samples: add FP formatting to all samples that require it
Samples that include floating-point format specifications may need
cbprintf FP support.  Make sure it's available.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-17 14:44:59 -06:00
Gerson Fernando Budke 0d216924d5 samples: net: cloud: Introduce TagoIO IoT cloud http post
Introduce TagoIO IoT Cloud HTTP post client example.  This explorer
Zephyr network resources to demonstrate an end to end application.
The TagoIO allows that any user can test on a easy way Ethernet, WIFI
and Modem (PPP) with BSD sockets.  The example provides overlays to
configure WIFI and Modem.

The application consists an a pseudo temperature sensor that sends
periodically data to TagoIO IoT Cloud platform.  The data can be
visualized on a web browser dashboard, cellphone or tablet.  The
steps to configure TagoIO are described on the example documentation.

Special Variables:
 - CONFIG_TAGOIO_DEVICE_TOKEN   DEVID  token generated by TagoIO
 - CONFIG_TAGOIO_HTTP_WIFI_SSID SSID   when using WIFI
 - CONFIG_TAGOIO_HTTP_WIFI_PSK  PASSWD when using WIFI
 - CONFIG_MODEM_GSM_UART_NAME   UART   label when using MODEM
 - CONFIG_MODEM_GSM_APN         APN    when using MODEM

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-04 09:06:23 +02:00
Jan Pohanka c737cca7be net: mqtt: fix sample to use zsock_ functions
Use zsock_ variants of socket functions in mqtt sample application.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Anas Nashif dca317c730 sanitycheck: inclusive language
change whitelist -> allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-27 07:04:07 -04:00
Flavio Ceolin c4f7faea10 random: Include header where it is used
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Alexey Markevich 2d8e71ba0c samples: net: google_iot_mqtt: fix CONFIG_CLOUD_CLIENT_ID value
According to
https://cloud.google.com/iot/docs/how-tos/mqtt-bridge#configuring_mqtt_clients
MQTT client ID format.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-07-07 16:26:51 -04:00
Alexey Markevich 7b2b957cbd samples: net: google_iot_mqtt: remove unused definition
Remove unused definition.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Alexey Markevich 079f158451 samples: net: google_iot_mqtt: use sntp_simple
Simplify overall scenario using sntp_simple to keep main MQTT logic more
clear. Also, remove related code which was used only by the old SNTP
code, e.g. show_addrinfo().

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Alexey Markevich bf9aaa4b34 samples: net: google_iot_mqtt: fix subscription qos initialization
Callback used mqtt_publish_qos1_ack but mqtt_subscribe called with
default 0 value (MQTT_QOS_0_AT_MOST_ONCE)

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-17 13:03:51 +03:00
Reto Schneider 0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Alexey Markevich b9f6e33afb samples: net: google_iot_mqtt: fix log typo
Wrong port number logged.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Alexey Markevich d6d5ae170a samples: net: google_iot_mqtt: log actual error
Error logging was using the wrong variable.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
David Brown a7d35b7984 samples: net: google_iot: Clarify key type docs
Clarify in the docs the importance of generating a key type that matches
the configuration used to sign JWT tokens.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown fb137098c9 samples: net: google_iot: Add config template to prj.conf
Add the template config values to the prj.conf.  These will need to be
changed according to the instructions in the README.rts.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown 961e7e707e samples: net: google_iot: Fix unclear documentation
The instructions on setting the necessary Kconfig values is unclear.
Add a description based on values that can be found in the Google IoT
Core console.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
Jukka Rissanen ae7da57cf4 samples: net: cloud: google: Convert to allow new timeouts
Fix timeout handling in the code so that we do not need to
enable legacy timeout.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-08 15:10:42 +02:00
Jukka Rissanen 65a1bebe85 net: Replace NET_WAIT_FOREVER by SYS_FOREVER_MS
As we now have SYS_FOREVER_MS, use that instead of network
specific NET_WAIT_FOREVER.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 16:29:23 +03:00
Ravi kumar Veeramally b78c9dca52 samples: net: cloud: Fix polling incoming messages
Topic subscribe() will allow cloud to send messages to
device. There will be a bit of network delay. But mqtt_input
was called only after publish() which will trigger every
10-15 seconds. Which is causing more delay to read published
messages from cloud even though messages are already available
at socket level.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-05-05 14:10:44 +03:00
Johan Hedberg a03a54f00c net: samples: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Ravi kumar Veeramally cd679452b2 samples: net: azure: Add support for subscribe
Cloud to device communication supported with simple
subscribe topic details. Details are added for how to send
messages from cloud.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-03-19 11:09:44 +02:00
Jukka Rissanen 7b8aca3de2 samples: net: cloud: Fix the mqtt_azure sample location
The path to the mqtt_azure sample was not correct.
Original patch by Benjamin Cabé.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 10:25:48 -04:00
Carles Cufi 07ecb817ff samples: net: google_iot: Fix logging warnings
Clean up the logging warnings due to invalid formatting.

Fixes #22510.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-06 10:00:49 +02:00
Ulf Magnusson cf89ba33ea global: Fix up leading/trailing blank lines in files
To make the updated test in
https://github.com/zephyrproject-rtos/ci-tools/pull/121 clean, though it
only checks modified files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-27 17:41:55 -06:00
Robert Lubos 665d195f3a net: sockets: tls: Add missing symbols for a few options
`TLS_PEER_VERIFY` and `TLS_DTLS_ROLE` options accept specific values,
yet no symbols were defined for them. In result, magic numbers were used
in several places, making the code less readable.

Fix this issue, by adding the missing symbols to the `socket.h` header,
and using them in places where related socket options are set.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-20 09:58:23 +02:00
Ulf Magnusson 9c9eb3452b kconfig: Fix some formatting nits
Same deal as in commit bd6e04411e ("kconfig: Clean up header comments
and make them consistent") and commit 1f38ea77ba ("kconfig: Clean up
'config  FOO' (two spaces) definitions"), for some newly-introduced
stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-21 10:30:02 -05:00
Jukka Rissanen 51fc680ba2 samples: net: google_iot_mqtt: Do not compile by sanitycheck
The sample needs key.c file but that cannot be generated by
sanitychecker. So disable compilation by sanitycheck.
Eventually we should make it possible to compile the sample
using some pre-defined values so that the sample will not
bit-rot but that is for later.

Fixes #21450

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-17 15:44:55 +02:00
Ravi kumar Veeramally 523a88ea4f samples: net: cloud: Move cloud based samples
MQTT Azure and Google IoT samples are based on cloud
infrastructure. It would be nice to place all cloud
based samples in one single folder.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-17 08:33:52 +02:00