After #41918, DEV_CFG removal triggered discard qualifer warning
during build. As uart_hal functions don't required const qualifier
and uart_context_hal_t has modified data, this PR moves hal instace
to data struct instead of config struct.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
After #41918, build started to warn discard qualifer
in config struct. This adds const into those structs.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Accidentally merged a PR before the manifest was updated. This
fixes the NXP HAL reference to the proper SHA.
Signed-off-by: David Leach <david.leach@nxp.com>
Add new sample application for direction finding to show
how the functionality works in connected mode for peripheral role.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add new sample application for direction finding to show
how the functionality works in connected mode for central role.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Update hal_nxp to add support for mimxrt1050_evk_qspi.
This board should support both boot-from-hyperflash and
boot-from-qspi. This modification enables a modified board
to boot from the on-board qspi nor chip.
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
1. Setup VDD_SOC with the appropriate setting
depending on the SoC
2. Do not configure PLL_SYS and PLL_USB. These
are already configured by the ROM code using
the DCD
3. Fix setting for USDHC clock
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The CP bit is read in DF connected mode while interpreting
LL_CTE_RSP PDU, hence it must be available in struct pdu_data
type.
There were missing two Kconfig options in new LLCP tests.
They were reponsbile for disable of CP bit instruct pdu_data.
That caused tests to fail during compilation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add missing implementation for disabling CTE request and resposne
control procedures.
If any of these commands is active in LLL then ULL context has
to wait before return. The wait mechanism is based on semaphore.
The semaphore is initialized in ULL context and given by code
responsible for command completion.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fixes build issues for tests in related with CTE REQ and
hci commands.
Fixes issues in unit tests for CTE REQ/RSP control proedures.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
When there is pending local control procedure that has instant
it should be possible to run remote control procedure without
instant because there is no collision.
There were missing code to run this case in rr_st_idle() of
refactored LLCPs.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There are packet restrictions imposed by PHY update procedure
for PDU that includes CTE (BT Core 5.3 :
- central/peripheral can't send PDU with CTE after receive or send
LLPHY_UPDATE_IND until instant if the PHY after instant is CODED
- peripheral can't send PDU including CTE after it sends LL_PHY_REQ
PDU until receive LL_PHY_UPDATE_IND, LL_UNKNOWN_RSP, LL_REJECTED_EXT_-
IND_PDU if there is a CODE PHY in TX_PHYS
- peripheral can't send PDU including CTE after it sends LL_PHY_RSP
PDU until receive LL_PHY_UPDATE_IND if there is a CODED PHY in TX_PHYS
of LL_PHY_RSP PDU or RX_PHYS of LL_PHY_REQ PDU.
The BT 5.3 Core spec defines only one PDU that may include CTE, that is
LL_CTE_RSP PDU. To avoid a situation that there is such PDU enqueued
for transmission in LLL when packet transmission restrictions should
be applied, both procedures in almost all cases will not be executed
in parallel.
Current implementation always handles remote procedurerequest first.
There are possible three scenarios:
1. Remotely requested PHY update. Locally initiated CTE REQ.
In this case there is no problem with LL_CTE_RSP waiting in a TX
queue in LLL. Both procedures may be executed one after another.
2. Remotely requested CTE REQ. Locally initiated PHY update.
In this case the CTE REQ is handled first and it will pause the
PHY update procedure until LL_CTE_RSP PDU is acknowledged by
remote. Then the CTE REQ procedure will be completed and PHY update
continued.
3. Locally initiated PHY update is pending. Arrives remote CTE REQ.
In this case the CTE REQ will be paused until localy initiated PHY
update is completed. Then the CTE REQ will be continued.
Thanks to that there should be no PDU including CTE in LLL TX quueue.
That releases us from a situation there is a LL_CTE_RSP PDU in the
LLL TX qeueue that must be changed into LL_REJECT_EXT_IND PDU due to
change of PHY to CODED PHY after PHY update procedure completes.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
In peripheral role when:
- data length update is enabled
- the CONFIG_BT_MAX_CONN is set to 1
the PHY update control procedure after reaching instant sends two
notifications to host. It notifies host about PHY update and data
length change. Both notifications are send one after another, so two
free node rx are required. The number of available node rx in
provided conditions is one. The PHY update FSM is stalled in waiting
state for enough empty node rx. At the same time remote device is
allowed to send new remote control procedures. Received request are
handled by PHY update FSM that asserts due to unknown procedure opcode.
The commit changes number of allocated nodes to be two times a number
of LLCP connections.
This is a workaround for the issue. The best solution seems to be
sharing nodsx between connections. Though this solution requires
buffering remote control procedures until host notification is done.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Macros responsible for preparation of packet configuration flags in
regard of PHY and CTE were wrong. PHY flags are not used as regular
integer values but bits in a bitfield, hence size of the field in
packet configuration flags is three instead of two.
In such case CTE presen filed should be moved to bit 4th.
The problem was spot when testing implementation with CODED PHY
enabled. When device was sending PDUs that had attached CTE the
radio was configured to use CODED PHY due to wrong bit set in
packet configuration flags variable (overlapping of CTE bit
with CODED PHY bit).
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were no handling of HCI_LE_CTE_Request_Failed event.
The commit adds missing implementation. An application will
be notified about failed request by cte_report_cb. It is the
same callback that is used for reporting collected CTE IQ
samples. The same callback was used to avoid creation new callback.
To give an application possibility to distinguish between regular
IQ samples report and request failed additional member err was added
to bf_df_conn_iq_samples_report structure.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
CTE request control procedure may failed due to rejection by
peer device or due to receive of LL_CTE_RSP PDU without CTE.
These events has to be reported to host by HCI_LE_CTE_Request_Failed.
The commit adds missing functionalit.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Integrate existing CTE request control procedure code in ULL with
implementation of refactor LLCPs.
The commit includes code responsible for:
- enabling CTE request and scheduling its execution by refactored
LLCPs framework,
- running CTE request periodically
- disabling CTE reqest in case it is running periodic
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There are data received from peer device with CTE request.
These data are not part of local CTE request procedure and
they don't belong to CTE response configuration, hence separate
storage was provided.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
ant_sw_len and ant_ids members of the structure llcp_df_rsp_cfg
were not used. These data are stored in lll_df_conn_tx_cfg
that is member of lll_conn. Unused members are removed.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Part of the CTE request procdure that is related with handling of
remote request should be compiled when CTE RSP is enabled.
Withouth it CTE response will not work. Local CTE request does not
need code reponsible for handling of remote reques.
The commit changes conditional compilation guards.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were missing initialization for CTX request and response conotrol
procedure related variables. The variables were zeored on system
startup but not initialized when a connection is established.
In case of re-use of connection instance for new connection it was not
possible to setup procedures again.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Request interval is a number of connection events that
is used to periodically run CTE request control procedure.
BT 5.3 Core Specification defines it as 2 octets long.
It had wrong type uint8_t. Changed to correct one uint16_t.
The commit also changes type of cte_rsp_en field of lll_df_conn_tx_cfg
to state that it is a boolean flag.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
CTE type and length parameters in connected mode are dependent
on remote CTE request procedure. These parameters are required
to setup radio to correctly transmit CTE. The same parameters
are also included in CTEInfo byte of data channel PDU header.
The parameters were provided to LLL with PDU to be transmitted
and by lll_conn::df_tx_cfg, hence it was redundant.
The PDUs CTEInfo has to be set before transmission anyway.
The contents of the PDU are set in ULL by CTE RSP control
procedure. To remove redundancy CTE length and type from lll_df_-
conn_tx_cfg were removed from ll_df_conn_tx_cfg. It was better
option becuse it saves instructions in LLL.
Radio in connected mode was configured by lll_df_conn_cte_tx_enable.
The function just unpacked the lll_df_conn_tx_cfg mebmers and
called static function df_cte_tx_configure.
Instead of extending parameters list of lll_df_conn_cte_tx_enable,
the function was removed and df_cte_tx_configure was changed to
be global function - lll_df_cte_tx_configure.
Now LLL directly passes all parameters from pdu_data::cte_info
and ll_df_conn_tx_cfg to lll_df_cte_tx_configure.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The llcp_pdu_encode_cte_rsp functio didn't set pdu_data fields related
with CTE transmission. The commit fixes that.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were wrong conditions in rp_comm_tx function for CTE request
that vefiry if:
- PHY is allowed one,
- CTE length is within allowed value.
The commit fixes it.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The CTE reception and sampling in connected mode was enabled
with CONFIG_BT_CTLR_DF_CONN_CTE_REQ. This is a separate fearure
tha can be enabled when CTE reqest procedure is disabled.
What more the CONFIG_BT_CTLR_DF_CONN_CTE_REQ is dependent
on CONFIG_BT_CTLR_DF_CONN_CTE_RX, not other way around.
The commit adds separate Kconfig to provide such possibility.
Also changes compilation guards for code related with the
CTE reception and sampling.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The implementation of the ll_df_set_conn_cte_req_enable function was
based on former implementation of LLCPs. The CTE request and response
control procedures are not implemented in former LLCPs framework.
The code has been updated to use data structues from refactored
implementation of LLCPs.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were missing code responsible for execution of HCI_LE_Connection_-
CTE_Response_Enable HCI command.
The commit adds missing implementation into hci and upper link layer.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Updated H4 driver to initialize setup function. Finally bt_h4_vnd_setup
function must be implemented in vendor-specific HCI extension module if
CONFIG_BT_HCI_SETUP is enabled.
BT_HCI_SETUP feature is useful when the BT Controller requires execution
of the vendor-specific commands sequence to initialize the BT Controller
before the BT Host executes a Reset sequence.
To enable this feature the CONFIG_BT_HCI_SETUP should be enable.
Fixes#41140
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Updated hci_init function to call HCI vendor-specific Setup function
(bt_dev.drv->setup()) on beginning of HCI initialization.
This feature need when the BT Controller requires execution of the
vendor-specific commands sequence to initialize the BT Controller before
the BT Host executes a Reset sequence. To enable this feature the
CONFIG_BT_HCI_SETUP should be enable.
Fixes#41140
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
- Added config BT_HCI_SETUP to enable HCI vendor-specific Setup feature,
- Added pointer to 'setup' function in bt_hci_driver structure.
BT_HCI_SETUP feature is useful when the BT Controller requires execution
of the vendor-specific commands sequence to initialize the BT Controller
before the BT Host executes a Reset sequence. To enable this feature the
CONFIG_BT_HCI_SETUP should be enable.
Fixes#41140
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Address the issue mentioned in zephyrproject-rtos#7412
Using printf() with "%x" to print an off_t value produces the
following warning:
format '%x' expects 'unsigned int', argument has type 'long int'
228 | LOG_DBG("Erasing sector at 0x%08x", offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
| |
| off_t {aka long int}
In newlib off_t is long. Even though both int and long are 4 bytes wide
in the architecture in use, GCC wants to see "%lx" to printf() a long.
Using "%"PRIx32 still produces the same warning because PRIx32
(from inttypes.h) still expands to simply an "x" and not "lx".
PR zephyrproject-rtos#40004 has solved this by casting offset to
ssize_t. The same solution is emulated here.
Signed-off-by: Milind Paranjpe <milind@whisper.ai>
Fixed#41945
NO_PINT_INT can have the same value as a specific pin.
E.G. For 1 byte pint_pin_int_t it equaled interrupt1.
Now is instead always 1 higher than the highest pin.
Expects fsl to keep setting values from 0 to
(number of connected outputs - 1)
Signed-off-by: Martin Koehler <koehler@metratec.com>
Turns out that xt-xcc will bail when faced with a real core-isa.h (it
wants you to rely on the builtins in the compiler). Undefine __XCC__
to force it to actually parse and emit declarations for its own
header.
(Also adds a newline to the generated one-line C file to silence a warning)
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
A lot of tests need to be able to get their current tid and do some
action with it. It makes sense for the `before` function/rule to be
able to run in the same thread as the test. Note that the `after`
function does not run in the same thread because we need to guarantee
that it will run.
Signed-off-by: Yuval Peress <peress@google.com>
Fix for issue #41012 to allow compiler to treat
IRQn_Type to be more than 8-bit. This will ensure NVIC numbers
more than 127 (required for MEC172x device) will work
correctly with irq_enable() API
Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
Build shows warning due to incompatible
CPU vendor name. This fixes it and applies
necessary changes in files.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
We had a similar sequence for interrupt return, where we were
selecting (actually only for the benefit of qemu) the highest priority
EPCn/EPSn registers for our RFI instruction. That works much better
in python the preprocessor.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The kernel coherence cache flush code was using a scratch register to
mark the top of the stack. Likewise a good candidate for ZSR use.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This is actually Cadence-authored code, but its use of EXCSAVE1 as a
sideband input to the exception handler is very much in the same
family of tricks. Use ZSR assignments here too.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Zephyr likes to use the various Xtensa scratch registers for its own
purposes in several places. Unfortunately, owing to the
configurability of the architecture, we have to use different
registers for different platforms. This has been done so far with a
collection of different tricks, some... less elegant than others.
Put it all in one place. This is a python script that emites a
"zsr.h" header with register assignments for all the existing users.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Bug #40189 tripped over an interesting synchronization scenario that
wasn't called out in the docs. Poll signals are level triggered, and
if you're adjusting the level from a racing context (e.g. resetting it
before the next "event" from an ISR or another thread) the polling
thread might wake up but then miss the event. Mention this case
explicitly in documentation.
Fixes#40189
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>