Commit graph

42559 commits

Author SHA1 Message Date
Andrei Emeltchenko
1c65da5ed7 Bluetooth: Check returned buffer is not NULL
Buffers returned by bt_uart_evt_recv() and bt_uart_acl_recv() may be
NULL in theory. This makes code consistent by checking return value.

Change-Id: Id39def39c8b1c4c6eefc7b2bf01702c54b3e565c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:17 -05:00
Luiz Augusto von Dentz
d80a8fc845 Bluetooth: Add write support to CCC in peripheral sample
This adds write callback to CCC descriptors storing the value in a stack
variable.

Change-Id: I8cd2567c6fee730500b446192b73fc82d86ba1ff
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Luiz Augusto von Dentz
96ac8de38f Bluetooth: Add implementation of ATT Write Response
Write attributes matching handle generating a proper response if
necessary:

< ACL Data TX: Handle 3585 flags 0x00 dlen 5
      ATT: Write Response (0x13) len 0

Change-Id: I7c230501e042a1a759baa2653944bef830b51779
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Luiz Augusto von Dentz
e7ac889bf0 Bluetooth: Fix codying style of EIR defines
Hexadecimal values should be in lower case.

Change-Id: Id79347997bab0673fb90f6f00ec9c2cff1440ee2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Andrei Emeltchenko
96f7d7bc42 Bluetooth: Add Current Time notify and CCC
Add Notify property and Current Characteristic Configuration to Current
Time Service in peripheral app.

Change-Id: I44f36eea4f129c7b407b045da892f2ba88338592
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
9a8272a44d Bluetooth: Simplify stack analysis code
Move the usage reports into the function that does the analysis, and
also include a percentage of the usage. To make the results more
relevant give them in terms of the "real" stack size, i.e. the stack
space minus the CSS size in the beginning.

Change-Id: Ibc0418de396e140839c9a810196fbf16df533df5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
12229a8f49 Bluetooth: Fine-tune stack size adjustment for debug
512 is a more accurate description than 1024 of the stack usage impact
of enabling debug logs.

Change-Id: I4b79b4eb9724ba624ff546973a1126c62382d1aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
8eabf208d7 Bluetooth: Add convenience macros for defining stacks
To not have to always do the __noinit, debug log correction and 4-byte
alignement declaration create some helper macros for defining the
stacks.

Change-Id: I2de5068d7044af3f348ed01281498a777d04c97d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
fadbdcef85 Bluetooth: Support unaligned stack arrays
The CCS always starts at a 4-byte aligned boundary, so if the stack
given to fiber_start doesn't begin in such a place there will be some
unused bytes in the beginning and the 'real' stack will start at a
different offset. Take this into account when calculating the unused
stack portion.

Change-Id: I6c36d0354f4d014ad256b5580b76282d7d4384ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
f51c6a4b41 Bluetooth: Use sizeof() for stack when starting fibers
In case there are changes to the way the stacks are defined it's safer
to use sizeof() rather than rely on some specific size define.

Change-Id: Ic9ae090c0dbc0d88995a8883f9b4876be5958f1d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Johan Hedberg
16faa55df8 Bluetooth: Remove unnecessary printk() for stack analysis
This one doesn't really contribute anything extra to the other info
that's already logged.

Change-Id: I741fa1a161914915bee0870dc102a7d0acfe0a33
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:17 -05:00
Andrei Emeltchenko
fae27b9587 Bluetooth: Add Current Time Service to peripheral app
Add Current Time Service currently providing hardcoded time since
there is no way of getting current time in the OS.

Change-Id: I9954d51f77905230a6dd180f37d3a48f379c69ec
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:16 -05:00
Andrei Emeltchenko
6a8ba74df5 Bluetooth: Add UUID definitions for Current Time profile
Change-Id: I7f953d0f4819924a1f08bbd495dcb3cf4adc1ee3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:16 -05:00
Johan Hedberg
c82b96d425 Bluetooth: Tune stack sizes based on latest analysis
Set the stack sizes based on what the current utilization is for SMP
and GATT tests.

Change-Id: I892282a088d7b244f7abdbc92368addc9c19e4eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:16 -05:00
Johan Hedberg
8e5721e326 Bluetooth: Add code to analyze stack usage
To make it easy to periodically verify that we have sane stack sizes
it's helpful to have some code to evaluate how much of the stacks are
used. There's already a CONFIG_INIT_STACKS option which pre-fills the
stacks with 0xaa bytes, so we make use of it and in case the option is
enabled run the extra code to evaluate how much of each stack was
used. The trigger for the evaluation is a disconnection event.

Change-Id: I815ff96b2e6f877c29f4df3c949afae78222a8f3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:16 -05:00
Johan Hedberg
c31b2064ed Bluetooth: Declare fiber stacks as __noinit
No need to waste CPU cycles initializing the stack variables.

Change-Id: Ifab0cf77ffb46d93aecb9a3082155478de782736
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
089a10b128 Rename documentation project
Also use substitutions globally.

Change-Id: Ieafec21820e73c4befe0979dbc1a43ecdf5178a9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Dan Kalowsky
4e66e9922d Adding coding conventions
Converting the coding conventions documentation over to the new format

Change-Id: I9f2552436e59c48a9fb9103834ad5a5d9c4bcc0f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Dan Kalowsky
1e4624ea23 Adapt installation guide with current requirements
- Update naming where it makes sense
- Fix a few spelling and phrasing issues

Change-Id: If08a7c77a35624adfdaafc276850b6d896356441
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
e2ae670982 Rename timo-env.sh to zephyr-env.sh
Change-Id: I50dfa427f87c1f2a90facf54ef3b58cd4c47a0ec
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
652309470c Rename tinymountain -> zephyr
Remove excessive use of zephyr and use a more generic
terminology where possible.

Change-Id: Ida8916765dbe824f63d7a4cedba60b35d14aee55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
b8823770d2 Rename TIMO -> ZEPHYR
Change-Id: Id44a129e275fb0cfe1fce6ec2a03c2d86ffe3995
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
8accfcfb2c Rename timo-env.sh and timo-env_install.bash
These files now use the zephyr- prefix.

Change-Id: Iab24bc1fc15e7b7e40922996ba338763638644bf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
54ac4484d7 Rename VXMICRO_ARCH and VXMICRO
Change-Id: I6f3858de98333ec466aa876c5f2887faa8e276e2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
f2520f87a2 Rename VXMICRO_ARCH_arc -> CONFIG_ARC
Change-Id: I4aca181523f50f43ee01e1be0c20a9ad844ef618
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
274622ea69 Rename VXMICRO_ARCH_arm -> CONFIG_ARM
Change-Id: I32b2e39781825504e7936b3df0c864988650c35c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
191fc279ce Rename VXMICRO_ARCH_x86 -> CONFIG_X86_32
Change-Id: Ie1bcfebce1db838ea994cb3626396ea032225830
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
2eb30f3aac Remove dos carriage return
Change-Id: I9732769550c01a0341104d3f8778c152d7745a94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
61eff496e0 kbuild: link using ${LD} instead of ${CC}
Not all GCC toolchains generate a fully linked image (non-relocatable) when
using ${CC} for linking.

Change-Id: Id99501b6510cd6eeb87f245a6273fcebd6d36cde
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
fb624c9d54 kbuild: Add libgcc.a directory to xtools search path
Informs the 'xtools' toolchain where to look for the libgcc.a library when
linking.

Change-Id: Ic990f1522dd8ddc9c5baf1366505e49929130969
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
28846dbf82 kbuild: Specify -march when using ARM cortex-m3/m4
Some compilers default to a value for -march that is incompatible with the
specified -mcpu setting.

Change-Id: Id94fc6666efe86ab511cf2320bf07b2eb70d72ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
cbf6d5b470 kbuild: Update xtools toolchain default versions
Aligns the default version of the xtools toolchain to that specified by the
x86.config and arm.config files under 'scripts/cross_compiler'.

Change-Id: Ib05766871a85de98c5ead19e15d740073f2f42cf
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
ad71ba6fa1 Ensure k_args fields are properly aligned and packed
The size of the k_args strcture must be equivalent to ...
    CMD_PKT_SIZE_IN_WORDS * sizeof(uint32_t)

This is complicated by the fact that not only do different compilers treat the
size of 'bool' and 'enum' types differently, they may also pad structures
differently.  Both of these differences have direct impacts on the k_args
structure.  To work around this, the k_args fields 'alloc' and 'Comm' are
forcibly aligned to a 4-byte boundary, while the rest of the k_args structure
is packed.

Change-Id: I722f1a585e5e34a7a7218ed0b214b54fac6d39f7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
53bee67642 Remove unused files from scripts/
Mostly files related to kernel modules and scripts used
in old build system.

Change-Id: I12dfe4c976b0f6f933b519bd7eb96148f689535d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
f05ee8f3b0 Remove more kernel module related references
Change-Id: Ic8eb2b062bdc0376aa5a463654da32d6ddb7b151
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
e06da7bd65 Remove packaging dependencies
Change-Id: Ife53df325c1ddad26299c6c6075338d2225f49b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
79635e002a Remove depmod and dependencies
Change-Id: I70325e049fbde1a965b9d845683cb7799fa54382
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
952a200072 Fixed make target for running in qemu (nanokernel)
Change-Id: I583ad5ad4985c835c0c6a0d31300f08b49e0f222
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
ebedf4805c Fixed make target for running in qemu (microkernel)
To run qemu, we only call 'make qemu' now

Change-Id: Iedf70434c8d757d9b9a252652110eb1d91489d86
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Jukka Rissanen
781b627f8c Add __may_alias macro to GCC toolchain
This is needed when one wants to avoid gcc
"dereferencing type-punned pointer" warnings.

Change-Id: I7bfd68fabb07deb64908cb0eaa833bdc5c8a4e08
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:16 -05:00
Szymon Janc
6d27b0a33c Add simple UART driver
This driver is a very simple UART driver that can be used to implement
a protocol in application. It has no protocol logic and just allow
application to receive and send data over UART in platform independent
manner.

API is designed to minimize number of required memory copies.
Application is able to provide new buffer every time it decides to
consume received data. It is also able to just alter offset and
reuse current buffer eg if data was corrupted or otherwise invalid.

Change-Id: I8d3827fe2e242196e986d0419bc5487357481558
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:16 -05:00
Allan Stephens
072961cda4 Rename VXMICRO_BSP_BASE to ZEPHYR_BSP_BASE
Updates this environment variable to reflect the new OS name.

(Note: Out-of-tree builds are not yet supported.)

Change-Id: If26264c39a98d76c418f07be88ecb196f34fba1c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:16 -05:00
Allan Stephens
63c7d00584 Rename VXMICRO_BASE to TIMO_BASE
Updates references to this environment variable, which were missed
during previous renamings.

Change-Id: I1126271ce8b84d3eaedeab11198d3a3b645393af
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:16 -05:00
Allan Stephens
06f10df990 Eliminate references to VXMICRO_TOOL
Since the build system now supports only one toolchain, the
VXMICRO_TOOL environment variable is obsolete. The sanity
check scripts that reference this symbol are revised accordingly.

(Note: As a temporary measure, the main sanity check script
continues to accept the -T option; however, the option has no
effect.)

Change-Id: I383b128b9f5b07164abb7ddeb5a699d819a20316
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
570795f014 Rename VXMICRO_JOBS to ZEPHYR_JOBS
Updates this environment variable to reflect the new OS name.

Change-Id: Icc6a2f3d4cdfcf7cab11da7920aaa8110177047b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
74b98c1cc4 Rename VXMICRO_GCC_VARIANT to ZEPHYR_GCC_VARIANT
Updates this environment variable to reflect the new OS name.

Change-Id: Iba9230466fbfda786be7d1265927b4ecc4c7dd93
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
815c6406bc Rename VPF files to use MDEF file extension
The file extension indicates a "Microkernel DEFinitions" file,
and no longer reflects the obsolete VxMicro/Viper branding.

Change-Id: Ib95b271404a4a4737e851d603c371244fa609e4d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
b36b379af3 Eliminate VxMicro branding in sanity check scripts
Change-Id: I5cf0c49a986b75f8ea1169f36542d39a3394121d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
f94682bafb Eliminate VxMicro branding in build system
Change-Id: Ie0f34b36e58ee0ea8e7438742d4448be1c393913
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
5189844df5 Eliminate VxMicro branding in kernel code
Eliminates references to the obsolete OS name. In most cases the
name is simply removed, as it isn't necessary.

Change-Id: I32f9e7390e436aec008a9454b72657e129d65152
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00