- Added esp32s3_board_spislavedev.c with board-level SPI slave logic
- Added esp32s3_board_spislavedev.h public header in common/include
- Updated Make.defs to include the new source when CONFIG_SPI_SLAVE_DRIVER=y
- Adding spislv board config to esp32s3-devkit
- Adding documentation of esp32s3 devkit spi slv
- Fixing path include in esp32s3_board_spislavedev.c
- Fixing relative path in the header of esp32s3_board_spislavedev.h
- Removing neasted check in Make.defs, consistency reasons
This provides initial support for SPI slave device initialization
on ESP32-S3 boards, making the feature available under conditional
build configuration.
Signed-off-by: Thiago Finelon <thiago.sfinelon@gmail.com>
Version 2.2.0 of the SDK unified some headers under a new path.
Now both the old and the new paths are searched during compilation.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
When the task has TCB_FLAG_CPU_LOCKED it is locked to the CPU regardless
of the affinity. There is no need to switch the affinity back and forth.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Since g_assignedtasks only holds the running task for each CPU, it can
be just a vector. Idle tasks are already preserved in statically allocated
structures "g_idletcb", and can be used from there.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This fixes several places, where the sched erroneously checks if the scheduling
is locked on current cpu/task, when it should check if the scheduling is locked
on the target cpu/task.
The original code randomly caused a task to be added to the pending list, and never
taken out from there, leading to system halt.
For SMP, there is no need for the pending list. Each CPU has got it's own
running list (assigned tasks list), and pending tasks can just be kept in
the unassigned (readytorun) list.
In addition, the smp scheduling is changed in a way that every CPU just picks
up the tasks from the ready-to-run list themselves. Which task to pick is
not tried to be dictated by another CPU.
This also allows using up_send_smp_sched for asynchronously
- re-prioritizing a running task
- triggering round robin scheduling switch
Iow, no separate smp call mechanism is needed for those and the code can be simplified.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Change every occurence of up_switch_context to use this_task() as the first parameter.
"nxsched_add_readytorun" returns "true" if context switch is required. "nxsched_add_readytorun"
typically could only switch the assigned/running task to the one which is passed in as parameter.
But this is not strictly guaranteed in SMP; if other CPUs tweak with affinities or priorities,
it may be possible that the running task after the call is changed, but is some other
task from the readytorun list (and it should be, if there is higher priority one available or the
affinity of the added task prevents it to be scheduled in, but the previous head of the readytorun
list should run.
this_task() is always the correct one to switch to, since it always points to the tcb which was
just switched in by the nxsched_add_readytorun.
This is also a precursor to re-writing the SMP queue logic to remove pending lists for SMP.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
When exiting schedlock, that task should first take the critical section and
only after that decrease the lockcount to 0. Otherwise an interrupt might
cause a re-schedule before the task enters the critical section, which makes
the following code meaningless.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Add support for the Texas Instruments TMP112 I2C/SMBus digital
temperature sensor. Also add a new defconfig that includes
support for a TMP112 sensor and extend the existing documentation
to include its description.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
The Raspberry Pi pico-sdk was not available in the CI build process,
so the test builds for the rp2040 and rp2350 uCs could not execute the
last packaging stage. The SDK is now fetched and included, both at
runtime and in the Docker image.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
Prior to this commit, it wasn't possible to load ELF modules from
the external PSRAM. There were two main issues about it: 1) copying
data using the instruction bus was being used instead of the data
bus (this, per si, isn't a problem, but requires special attention
regarding data alignment), and 2) the cache was not being properly
cleaned and flushed to properly access the loaded data using the
instruction bus.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
If both SPI Flash support (`CONFIG_ESP32S3_SPIFLASH`) and PSRAM
(`CONFIG_ESP32S3_SPIRAM`) are enabled, the PSRAM can only be
assigned to the user's heap (`CONFIG_ESP32S3_SPIRAM_USER_HEAP`).
Additionaly, `CONFIG_ESP32S3_SPI_FLASH_SUPPORT_PSRAM_STACK` must be
set because the system will end up allocating tasks' stacks from
the external PSRAM. This has an impact when dealing with SPI flash
operations because the cache must be disabled and the running task
should not rely on any data from the PSRAM. To accomplish that, It
offloads the SPI flash operation to a work queue (which, by
definition, allocates its heap from the kernel heap).
The same (assigning the PSRAM to the user's heap) is valid when the
Wi-Fi is enabled because the lower-half driver requires data being
allocated from the internal memory (which can only be achieved by
allocating from the kernel heap when both the kernel and user heaps
exists).
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
This commit adds the missing `board_memorymap.h` file for all the
ESP32-S3's boards. This header file is necessary whenever Wi-Fi
is enabled, for instance.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
when the version of nodejs used during the installation of the dependency
library is too different from the version of nodejs actually used, we may
encounter version incompatibility issues, resulting in a runtime crash.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Use this command to extract archives.
Not all architectures are modified, only those commands I know
or could be logically deducted from the rest were added.
Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
The interrupt handler accesses the device as well as the driver's private
data. Thus, must take the big kernel lock in SMP mode to protect them.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
In SMP mode one CPU can be executing the MMC interrupt while another CPU
disables (e.g. via watchdog timeout). As it is disabled the other CPU
assumes it's safe to start configuring the device after this.
This causes a leak in the driver's private data as well as a mutual
exclusion leak on the device itself.
Fix this by aborting any triggered interrupt by checking whether it's
even enabled.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Update board reset with BOOTROM functions calls
- normal reboot
- reboot to bootloader
normal reboot and reboot bootloader now possible from nsh
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
Currently the irq handler checks many reserved bits, which is
a waste of resources:
1. pending_rx_ep bit 0 is reserved (always 0)
2. pending_rx_ep and pending_tx_ep have only bits 1, 2, 3 and 4
defined, no need to scan MPFS_USB_NENDPOINTS (9) bits as the
rest are reserved
Fix this by checking only the relevant bits.
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
packing the internal substructures will reduce the overall alignment of
`sockaddr_storage` to 2, which triggers an unaligned access warning
in 32-bit systems.
Add an overall 8-byte alignment to the outermost layer of the structure.
Related commit: 855336bf
Refer to https://datatracker.ietf.org/doc/html/rfc2553#section-3.10
Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
As emmcsd driver does not support separate WRCOMPLETE interrupt the
SDIOWAIT_WRCOMPLETE event shall not be waited.
The SDIOWAIT_TRANSFERDONE event indicates that both "transfer done"
and "write complete" events are completed.
mpfs_sendcmd() shall not wait for data lines ready before
sending commands to the card. This prevents mmcsd driver
to poll card busy status prior to next activity after
a write operation.
Add capture source files to the makefile pipeline.
STM32H7_CAP to STM32H7_TIMX_CAP for clarity.
Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
Add documentation for changes made in #16809.
Add an example defconfig for a nsh build with the capture example.
Replace the STM32H7_CAP option with just CAPTURE as the guard for the
lower half driver.
Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
Enabling a higher channel of the internal ADC had the effect of
initializing the lower ones as well. Now that happens only if
actively requested.
Also, the functions for handling the internal ADC did not follow
the typical naming used by comparable modules for the same arch
and were renamed for coherence. Informational logging calls were
also made slightly more useful and discernible in case of having
multiple ADCs.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
Add support for the RP2040's GPIO output override capabilities.
Implementation inspired by the uniqueid functions for the same arch.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
When delivering a signal to a kernel task, or in CONFIG_BUILD_FLAT with MMU
enabled, the REG_SCTLR_EL1 needs to be stored for exception return.
Otherwise 0 is restored to the register at exception return, MMU is switched off
and the system crashes.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
"hmac" was mistyped as "hmca", breaking linking to some prototype
functions. Also, a couple of includes were missing.
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
The strings "RPC2040" and "RP2040_IO_BANK0_GPIO0", presumably typos,
were used in place of respectively "RP2040" and "RP2040_IO_BANK0_GPIO".
Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>