Commit graph

41120 commits

Author SHA1 Message Date
Piotr Mienkowski
ab748e3afb soc: silabs_exx32: remove pinmap dependency on part number
Within a single series pin mapping between location setting and pin name
is uniform. The only difference is availability of the module, i.e. i2c1
may be missing on some part numbers, or availability of the pin, i.e.
32 pin package will not provide all the pins available on 48 pin
package. It's better to manage these differences at the DTS/Kconfig
level.

This commit removes dependency of soc_pinmap.h files on part numbers.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2018-11-29 09:46:28 -06:00
Stephen Yi
c50a883d1d boards stm32_min_dev: modify board led pin assignment
Modify board stm32_min_dev aka "blue pill" led pin assignment in dts
from PB12 to PC13.
This board has a user led connected to PC13.
Sample blinky and similar would run out-of-box without additional
circuit to readout PB12 level.
Tested blinky on corresponding board.

Signed-off-by: Stephen Yi <stephen.jin.yee@gmail.com>
2018-11-29 09:22:24 -06:00
Mieszko Mierunski
94b72e7bea drivers: nrf: Add UART and UARTE configure function.
Add UART configure function for UART and UARTE shims.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-29 14:59:35 +01:00
Jakub Rzeszutko
9643ed6d27 shell: fix double new line print for RTT backend
In case terminal sends `\r\n` on the Enter button
shell will go to the new line twice and it will print
prompt twice. This patch fixes it.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-29 11:54:56 +01:00
Theis Blickfeldt
bb68ac6c0b bluetooth: Updated comment in conn.h to clarify CB PoV
In conn.h the comments on src/dst in bt_conn_le_info and
bt_conn_br_info does not clearly state the point of view.
src could both be perceived as the connections point of view
(src = local address) or the call-back where the structs are
used point of view (src = remote address).
The comments about src/dst has been made more clear.

Signed-off-by: Theis Blickfeldt <ttjo@oticon.com>
2018-11-29 10:36:11 +02:00
Michael Scott
0abd92266a drivers: modem: wncm14a2a: correct comment in on_cmd_sockdataind()
The comment was incorrect explaining why we were sending an
AT-command without waiting for a response (via a K_NO_WAIT timeout).

Let's correct the comment and avoid confusion.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-28 15:34:19 -08:00
Michael Scott
e8a690ff70 drivers: modem: wncm14a2a: remove socket_reading logic
Remove overly complicated logic to skip incoming data if we were
still waiting on a previous set of data to be read.

This fixes a bug where an error during data receive could end up
with the modem ignoring all incoming data.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-28 15:34:19 -08:00
Andrew Boie
1c5642a402 boards: x86: don't turn on mem protection
This is not enabled at the board level.
tests/Kconfig turns this on for test cases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-28 15:33:11 -08:00
Andrew Boie
3ced428f2f tests: don't enable application memory
This shouldn't be enabled unless the test case is
specifically testing the feature.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-28 15:33:11 -08:00
Andrew Boie
1d720f504b x86: atom: do not select application memory
This should never be selected at the SOC level.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-28 15:33:11 -08:00
Flavio Ceolin
46715faa5c kernel: Remove _IntLibInit function
There were many platforms where this function was doing nothing. Just
merging its functionality with _PrepC function.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-28 14:59:10 -08:00
Aurelien Jarno
a0b9e70e10 c++: kconfig: EXCEPTIONS needs to depend on NEWLIB_LIBC
C++ exception support needs to use the newlib C library in order to get
the abort function. C++ exceptions also do not work with the simple
malloc/free implementation provided by the Zephyr minimal C library.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-28 13:51:35 -08:00
Robert Lubos
b5f9771252 net: mqtt: Fix NULL pointer dereference in logs
MQTT packet_length_encode function accepts NULL buf argument, therefore
it cannot be dereferenced without a check.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-28 13:09:46 -08:00
Robert Lubos
a26db60b2f net: mqtt: Add missing mutex_unlock
mqtt_connect was not releasing mutex after successfull connection.
Reworked the code to have a single exit path with mutex unlock.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-28 13:09:46 -08:00
Himanshu Jha
21224a9a78 samples: net: ws_echo_server: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
36279b69a8 net: lwm2m: ipso_temp_sensor: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
dbcc5392fe net: openthread: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
a273cfaf32 net: lwm2m: ipso_light_control: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
f411073c85 drivers: sensor: vl53l0x: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
3bff9b1b50 drivers: flash_gecko: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
13a3199ad3 tests: net: mgmt: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
5a4481415b tests: tinycrypt: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Himanshu Jha
40b5442699 coccinelle: Add script to remove unnecessary return variable
This script helps to remove bogus intermediate local variable
used in functions to store return value and instead return
directly while saving few bits of memory.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Olivier Martin
58245cd02f Bluetooth: Define log level at bluetooth subsystem level
This commit defines a default log level at bluetooth subsystem
level when module log level is not defined.

Prior to this change, the bluetooth subsystem would use
the firmware default log level.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-11-28 13:52:35 -06:00
Ashokkumar B
2652a81d98 drivers: spi: fix typo bug in spi_sam.c
* Change all occurance of sam0 to sam
     * Chande CONFIG_SPI to DT_SPI

Signed-off-by: Ashokkumar B <ashokkumar@zilogic.com>
2018-11-28 13:44:07 -06:00
Paul Sokolovsky
182ede4912 boards: qemu_x86: Remove QEMU options which break eth_e1000 driver
"-machine type=pc-0.14" appears to be the option which leads to
broken PCI emulation in QEMU, where PCI enumeration reports one
IRQ number (11), while actually IRQ 10 is emulated by QEMU.

"-vga none" and "-display none" appear to be just subordinate of
"-machine type=pc-0.14" and are required to get qemu_x86 into
bootable state.

Fixes: #11706

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-28 11:00:09 -08:00
Anas Nashif
8d84f9229c gitlint: do not start with subsys:
Commit messages should not start with literal "subsys:", instead, spell
out the actual subsystem name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-28 09:22:01 -08:00
Himanshu Jha
547e75723c net: llmnr_responder: Check return value of net_udp_get_hdr
net_udp_get_hdr() function returns NULL on failure. Therefore
handle its return value to avoid potential NULL dereference.

Fixes #11485
Coverity-CID: 189738

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 19:20:04 +02:00
Kim Sekkelund
bf11698ed9 bluetooth: host: Rename bt_conn_get_id and make it public.
There is not an easy way to relate an application's user_data to a
connection. One way is to save a pointer to bt_conn in the
application's user_data array upon connection establishment.
Each connection related callback function will have to loop for all
user_data and compare the saved pointer to the passed bt_conn
pointer. This is inefficient if there are many callback activations
during the connection.

This change makes the internal bt_conn mapping function accessible to
applications in conn.h. The function name is changed to
bt_conn_index() to clearly indicate that the function returns an
index of an array.
Add an ASSERT to catch illegal parameter.

Signed-off-by: Kim Sekkelund <ksek@oticon.com>
2018-11-28 18:20:38 +02:00
Ulf Magnusson
c1f4d677f2 menuconfig: Improve behavior for named choices included multiple times
Update menuconfig to upstream revision 38dff36b0f97b, to improve the
behavior for a case reported by Øyvind Rønningstad.

Upstream commit message:

    menuconfig: Only list duplicated choice symbols once

    When a Kconfig file defined a named choice and was included multiple
    times, the choice symbols were listed multiple times in the
    menuconfig as well (due to commit 17d7c1e ("menuconfig: Show all
    symbols at each menu location for multi.def. choices")).

    That's probably not what you want. Tweak it so that each symbol is
    only shown once, with the prompt that was used for it at whatever
    choice definition location is entered.

    Also change how the choice selection is displayed before the choice
    is entered, so that the prompt used for the selected symbol at that
    particular location is used. Previously, the prompt at the first
    definition location for the symbol was always used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-28 16:58:28 +01:00
qianfan Zhao
c43a116f41 soc: same70: don't switch main clock if already did
Don't switch clock to external clock again if the
bootloader already did.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-11-28 06:45:50 -06:00
Jukka Rissanen
4770528018 net: app: Remove extra log_strdup() calls
The _net_app_sprint_ipaddr() was calling log_strdup() when
creating the debug print string. This is not correct as
the log_strdup() can only be used when calling the logging macro
to print strings.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-28 14:25:25 +02:00
Vikrant More
0c29ca367d samples: mesh: nrf52: removed bug in Gen. onoff unack handler
In Gen. OnOff Unack handler, gen_onoff_publisher(model) was
misplaced previously & now it is set to proper location.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-28 13:39:03 +02:00
Henrik Brix Andersen
0cfaf3d75f samples: display: add sample for demonstrating custom CFB font
Add a sample application for demonstrating automatic generation of
Character Framebuffer (CFB) font headers at build time.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-28 11:46:00 +01:00
Henrik Brix Andersen
9e8c9ca8fb subsys: fb: add support for generating CFB font headers at build time
Add script and cmake functions for automatically generating Character
Frame Buffer (CFB) font header files from image files, TrueType, or
OpenType font files.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-28 11:46:00 +01:00
Ravi kumar Veeramally
7a5640f126 net: ipv4: Drop incoming packets with src addr is multicast
As per RFC1112 sec 6.2 "A host group address must never be
placed in the source address field or anywhere in a source
route or record route option of an outgoing IP datagram."

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-28 10:13:41 +01:00
Ravi kumar Veeramally
3746652f85 net: arp: Drop ARP requests from localhost address
If ARP Request with sender IP address set to localhost then drop
the request.

Fixes #11489

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-28 10:13:41 +01:00
Ravi kumar Veeramally
6227b12fb4 net: arp: Fix ptype for non arp messages
If network stack found ARP entry for peer address, then it
tries to send pending IP packet. But it always keeps ptype
as ARP only. In this particular scenario it has to be IP
packet.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-28 10:13:41 +01:00
Ravi kumar Veeramally
f2e0754718 net: ipv4: Drop the replies if src address in unspecified
Networking stack sometimes try to find source address based
on destination address. If interface could not find best match
then it returns unspecified address (0.0.0.0). Host should not
send these packets.

IPv4 reply related issues fixed.

Fixes #11329

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-28 10:13:41 +01:00
Ravi kumar Veeramally
0c547f9da9 net: arp: Discard ARP request on special scenario
Discard ARP request if Ethernet address is broadcast and
Source IP address is Multicast address.

REFERENCES:
RFC 826: page 4
RFC 1122: section 3.3.6 {Silently discard link-layer-only b'cast dg's}
RFC 1812: section 3.3.2, page 34

ARP related issues fixed.

Fixes #11329

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-28 10:13:41 +01:00
Alexander Polleti
97b7a0adb0 logging: reorder designated initializers in __LOG macro
As C++ does not support designated initializers, including this file
in a c++ file caused a compilation error.
gcc allows them if they are ordered as the members appear in the
struct definition

I tested it with an application using mqtt and ethernet.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-27 16:21:04 -08:00
Jakub Rzeszutko
6de96b1802 shell: fix make_argv function
Shell will now detect not terminated " or ' character.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-27 15:00:19 -06:00
Henrik Brix Andersen
4844afa04a samples: drivers: watchdog: enable debug logging
Enable debug logging in the watchdog driver sample application to aid
in debugging watchdog drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-27 14:15:58 -06:00
Henrik Brix Andersen
b52b79d15e drivers: spi: sam0: avoid unsigned comparision with less than zero
Avoid comparison of size_t with less than zero.

This fixes #11136.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-27 12:05:17 -08:00
Henrik Brix Andersen
4c533d053e drivers: spi: sam: avoid unsigned comparision with less than zero
Avoid comparison of size_t with less than zero.

This fixes #11136.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-27 12:05:17 -08:00
Ioannis Glaropoulos
61ccafa8a5 arch: arm: fix the convenience macro for ARMv7-M MPU
This commit fixes a bug in the ARMv7-M convenience macro that
evaluates write-ability of given access permissions attributes.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-27 10:11:18 -08:00
David B. Kinder
096e18c2f8 doc: fix broken link in upsquared board doc
Link to upsquared specifications was incorrect

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-11-27 18:19:21 +01:00
Olivier Martin
ff66b4b09a Bluetooth: host: Remove peer from CCC cfg
When removing a peer from a CCC, it also needs to be removed from
the attribute `cfg`.

Not removing it would create a shortage of `cfg` that could
prevent new host to pair to the BLE device.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-11-27 13:58:21 +02:00
Ramakrishna Pallala
dbf405ab21 power: Move application level API's to public header
Move the API's used by applications to include/power.h file.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-11-26 18:38:40 -08:00
Jakub Rzeszutko
80a8cfc6b6 shell: fixing printing macros
Update macros: shell_warn and shell_info to use correct
colour formatting.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-26 19:13:55 +01:00