Cap the Tx length by MAXLEN when doing a Tx.
(Note that just like in real HW, the transmitted length
field is not altered, so the actual Tx'ed packet is corrupted)
During Rx, handle properly MAXLEN:
Instead of erroring out when the received length is more than
MAXLEN, properly truncate the length during reception.
Check PCNF1 configuration for BLE modulation, to ensure
we only got a configuration we support.
(As other configurations are ignored).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In some cases, if shorts were used,
the timer may unexpectedly set events registers
that would correspond to future events already when
the short was happening,
or may incorrectly miss raising an event for a
simultaneously triggering timer CC.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
It is possible for a single event to trigger a task
twice either by the same task being both in a channel
TEP and FORK TEP, or by an event triggering
several enabled channels which trigger the same TASK.
In real HW this only cause that task to be triggered
once, but in the models it was triggered multiple
times => fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The event register write sideeffecting function also needs to be
replaced for simulation. Add it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
If a DISABLE or STOP was received during the first TxChainDelay (1us)
after a Tx START, the task would have been missed.
Fix it.
The issue was introduced in cee41373eb
where the actual Tx start was delayed by TxChainDelay.
Also set already the RADIO STATE register to TX
as soon as the TX START is triggered instead of postponing it
by that microsecond.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
When opening output files, create the folders if they are
missing, instead of assuming they already exist.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
* Added missing count compare functionality
* Now each timers has the right amount of CC
registers, events and tasks
* Interrupts are now level based
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
a) Fix for the HW automatically generated TIFS:
One condition which disables this HW feature was missing,
which lead to it being enabled when it shouldnt in some cases.
=> Fix it
b) Fix the DISABLED=>[TR]XEN shortcuts when automatic HW IFS is not used.
The shortcuts were missing in this case.
c) Postpone Tx request to the Phy until the last moment:
That is, do the request Tx_chain_delay later.
As otherwise, if another (pending) HW event was scheduled at the exact
same time as the Tx start it would cause the request to have an abort
reevaluation before the Tx start, which is a violation of the
protocol to the phy.
This issue was triggered, in low latency mode, where a TIMER event
was used to trigger the Tx start task, but could have been triggered
by other concurrent HW events.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Including all PPI EVENTS and TASKS connections,
and missing HAL replacements.
All nRF52833 TASKS are now working.
Though note most operations are still instantaneous,
and don't really do anything more than set registers
and trigger events/interrupts correctly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add models of the GPIO and GPIOTE peripherals
including PPI connections, and HAL replacements.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Although it is not normal, a really bad exit from the program
(due to a programming error) can result
in a double call to the HW clean up functions.
Let's protect it so it does not segfault.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Although it is not normal, a really bad exit from the program
(due to a programming error) can result
in a double call to the HW clean up functions.
Let's protect it so it does not segfault.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Some users are constrained about where they can
run the executable. Widen the search to include
the LD_LIBRARY_PATH.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The Nordic HAL now uses variadic macros, but in a not strictly
conformant way to the C standard, which results in thousands
of warnings when building with -Wpedantic.
Let's switch standard version to avoid this warnings.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add missing link to UICR docs
(The same file (NVMC) contains both components)
Add replacements for the new nrf HAL
read byte and read halfword functions.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Including the necessary hal replacements.
And add in the FICR the flash page info.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The detected issue is unlikely to cause any trouble,
but better to just fix it.
NRF_PPI.c:546:63: runtime error: left shift of
1 by 31 places cannot be represented in type 'int'
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Including the necessary hal replacements,
and connect its event in the PPI
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
RNG would not start again with a TASK_START if it was
stopped with the short.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The idea is that the CMSIS replacement (if any is necessary)
is provided by the integrating program.
Nonetheless, there is a minimal set we need to provide
here due to the nrfx dependencies.
Note that this change is accompanied by an equivalent change
in Zephyr's nrf52_bsim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Devices may need to update the abort substructure during
a header reevaluation.
Let's update the procedure so it is possible to do so.
NOTE!: This requires the equivalent update from the
2G4 Phy and 2G4 libPhyCom
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>