The existing __stack decorator is not flexible enough for upcoming
thread stack memory protection scenarios. Wrap the entire thing in
a declaration macro abstraction instead, which can be implemented
on a per-arch or per-SOC basis.
Issue: ZEP-2185
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The main thread was doing nothing but spawning another thread to perform
the test. Delete the alternate thread, and just do the test on the main
thread, adjusting stack size and priority as necessary.
Issue: ZEP-2236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Add a macro which signals to the compiler that use of the macro is
deprecated.
Example:
#define FOO __DEPRECATED_MACRO bar
Defines FOO to 'bar' but emits a warning if used in code.
Cannot filter out with -Wno-deprecated, so be careful with -Werror.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This patch ports helper scripts from python2 to python3
with following changes:
- print should be used with () in python3
- resolved bytes-like object is required, not 'str'
- added python3 header
ZEP-2054
Signed-off-by: punit vara <punit.vara@intel.com>
Board documentaion for altera_max10 referenced the nios2-configure-sof
tool in arch/nios2/soc/nios2f-zephyr/cpu/ when this tool is actually
part of the Altera Quartus SDK (the .sof FPGA configuration files are
in this folder)
jira: ZEP-2006
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This patch fixes a bug with the computation of the FLASH_LOAD_OFFSET
option that is derived as part of the DTS parsing. Offset should be
the relative offset from the base of flash. If the flash base address
and selected partition are the same, the offset should be 0.
JIRA: ZEP-2260
Signed-off-by: Andy Gross <andy.gross@linaro.org>
In certain TCP states we should not try to send RESET segment
to peer. So check this and do not try to use NULL pkt to send
a message.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The "net http monitor" command turns on HTTP monitoring,
which means that for each incoming HTTP or HTTPS request,
a information about source and destination address, and
the HTTP request URL is printed.
User can disable the monitoring by "net http" command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_DEBUG_HTTP_CONN is enabled, then start to collect
currently active HTTP connections to HTTP server.
This is only useful for debugging the HTTP connections.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Restrict encryption support on nRF51 series SoC to Bluetooth
LE 1M PHY and max. 27 bytes PDU. If 251 bytes PDU using Data
Length Update procedure is desired, then LE Encryption
procedure will not be supported (until a software CCM is
implemented in future).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Kconfig option to be able to conditional compile the
Bluetooth v4.0 LE Encryption procedure.
This is needed in order to be able to not support encryption
on nRF51 series when using Data Length Update procedure with
upto 251 byte payloads until a software-based CCM support is
implemented.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If we cannot send network data, then print the error code when
printing debug information about the issue. This is needed when
debugging the issue.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This https-client sample starts to send HTTP GET/HEAD/POST
requests same way as http-client, to https server that can
be found in net-tools repository.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add HTTPS support into http-client library. The init of the
HTTPS client connection is different compared to HTTP client,
but the actual HTTP request sending is using the same API as
HTTP client.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is done so that both http_client and http_server functionality
can share the same heap.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Various network samples contained QEMU slip setup instructions
or those instructions were missing. A reference doc in
doc/subsystems/networking/qemu_setup.rst file already has the
setup instructions for QEMU. So add a reference to that file
in samples/net/*/README.rst files and remove unnecessary slip
setup instructions in relevant files.
Fix various typos in readme files at the same time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
On some devices, when k_cpu_idle() was called we were getting
interrupts that were not the timer interrupt. On bbc_micro
a power clock control driver interrupt was happening instead
and k_cpu_idle() was returning without the system tick advancing,
failing the test.
The clock control interrupts seem to only happen early in device
boot; moving the idle test much later lets the test pass on this
board (and likely all other NRF5 based boards).
Issue: ZEP-2257
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Add tests for the newly-added JSON_OBJ_DESCR_OBJ_ARRAY. These pass.
Note that this also adds test coverage for decoding an array of
maximum length, to avoid regressing the recently-introduced fix for
this edge case.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Since JSON_OBJ_DESCR_ARRAY is suitable only for arrays of primitives,
add JSON_OBJ_DESCR_OBJ_ARRAY (and a ..._NAMED variant), to allow users
to handle arrays of objects.
Having a macro is important, given the unintuitive space optimization
used for storing the offset to the structure element containing the
number of elements in the array.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This function currently fails when decoding an array with number of
elements exactly equal to the maximum available in the struct.
To fix this, move the check for if the current field is past the end
of the array to just before attempting to decode a value. This allows
the last element to be followed by a JSON_TOK_LIST_END token in the
case that the array is full, and the function to return success.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
The JSON library doesn't properly encode arrays whose elements are of
object type. Fix that.
This fix avoids allocating a temporary descriptor on the stack, and
keeps the size of struct json_obj_descr unchanged, by preserving an
unintuitive size optimization made by the library. See the comments
in the patch for more details.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This (and JSON_OBJ_DESCR_ARRAY_NAMED) are really intended for handling
arrays of primitive type only. They don't allow users to declare
descriptors for arrays of objects. Clarify this in the Doxygen.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
When we build with newlib enabled and utilizing one of the other
variants (like having floating point enabled) we need to have the proper
library path setup to find the library. This is mimicked after what we
do in Makefile.toolchain.zephyr for newlib.
Issue: ZEP-2240
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Stack sentinel doesn't prevent corruption, it just notices when
it happens. Any memory could be in a bad state and it's more
appropriate to take the entire system down rather than just kill
the thread.
Fatal testcase will still work since it installs its own
_SysFatalErrorHandler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
- _SysFatalErrorHandler is supposed to be user-overridable.
The test case now installs its own handler to show that this
has happened properly.
- Use TC_PRINT() TC_ERROR() macros
- Since we have out own _SysFatalErrorHandler, show that
k_panic() works
- Show that _SysFatalErrorHandler gets invoked with the expected
reason code for some of the scenarios.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Fixes an issue where if a thread calls k_panic() or k_oops()
with interrupts locked, control would return to the thread
and it would only be aborted after interrupts were unlocked
again.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
One of the stack sentinel policies was to check the sentinel
any time a cooperative context switch is done (i.e, _Swap is
called).
This was done by adding a hook to _check_stack_sentinel in
every arch's __swap function.
This way is cleaner as we just have the hook in one inline
function rather than implemented in several different assembly
dialects.
The check upon interrupt is now made unconditionally rather
than checking if we are calling __swap, since the check now
is only called on cooperative _Swap(). The interrupt is always
serviced first.
Issue: ZEP-2244
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The wiki directions indicate that this script should be used,
and openocd.sh doesn't even work. Switch to pyocd.sh by default.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The Sam3x HAL defines __NVIC_PRIO_BITS to 4.
Fixes an issue where interrupt priorities and masking
were not being done correctly.
Issue: ZEP-2243
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The sample app "static_lib" is very important to Zephyr user, which
demonstrate how to build and link a static lib.
ISSM team wanted to integrate this app in their IDE for quark platforms.
However they find the in "static_lib/hello_world/Makefile" BOARD is
hardcoded as qemu_x86.
This patch supports other BOARD passed from build command.
I have verified this app working fine @Arduino101.
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This patch adds a condition on the FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE
to make them conditionally excluded if HAS_DTS is enabled. FLASH
partition information must be defined for all DTS platforms which
utilize flash.
For DTS enabled platforms, CONFIG_FLASH_LOAD_OFFSET and
CONFIG_FLASH_LOAD_SIZE will be generated from the flash information
defined in the DTS file. The values used for these variables will be
determined by the zephyr,code-partition chosen node. If no chosen
node is specified, the zephyr,flash chosen node will be used.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
The hard-coded value of 10ms doesn't take the system configured
amount of ticks per second, nor does it account for an unlucky
tick advance which causes the test to fail very intermittently
in QEMU.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
fixed literalinclude warning that referenced beyond end of file and
added lineno-start option to show correct line number of included file
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This commit fixes the compilation error that occurs if both UART
ports on the FE310 SoC are enabled. The error occurs due to the
missing function definition of uart_fe310_irq_cfg_func_1 .
Signed-off-by: Jens Peter Schroer <jens@manetos.com>