Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unloading and loading of ESP32 SPI linux kernel module behavior #548

Open
3 tasks done
iradmilo-bytelab opened this issue Nov 21, 2024 · 1 comment
Open
3 tasks done

Comments

@iradmilo-bytelab
Copy link

iradmilo-bytelab commented Nov 21, 2024

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

only once

Expected behavior

I am expecting graceful termination of SPI connection between Linux host and ESP peripheral after kernel module is unloaded and graceful load of module after loading it again.

Host MPU: STM32MP133F
WIFI/BT network adapter MCU: ESP32_C3
Comm interface: SPI
Commit: 927a34f

Actual behavior (suspected bug)

Please guide me if this is expected behavior and are there any issues based on the logs?
Why is there unregistered event on ESP side (I (1930) FW_CMD: Unregistered event: 3
) and is the cleanup on linux host side complete (logs are attached below)?

esp32_c3_peripheral.log
linux_host.log

During testing there was one occasion where module would not load properly and wlan0 interface did not show up.
However I cannot replicate it at the moment. Issue appeared only once.

Note that kernel module is automatically set to load at bootup.
Module is loaded with these options:

cat /etc/modprobe.d/esp32_spi.conf
options esp32_spi resetpin=71

module location:

/lib/modules/6.1.28/extra/esp32_spi.ko

and depends upon and loads these modules:

cat /lib/modules/6.1.28/modules.dep
extra/esp32_spi.ko: kernel/net/bluetooth/bluetooth.ko kernel/crypto/ecdh_generic.ko kernel/crypto/ecc.ko kernel/net/wireless/cfg80211.ko kernel/lib/crypto/libaes.ko

Additional question, do bluetooth and cfg80211 drivers need to be loaded and unloaded every time you load kernel module (since I am not manipulating them directly after startup at the moment)? However performing the action of unloading other module would be inconvenient to us since other programs could use them.

Error logs or terminal output

No response

Steps to reproduce the behavior

  1. Create esp_hosted_ng solution with SPI connection
  2. Load module at bootup
  3. Unload module with: modprobe -r <kernel_object>
  4. Load module with: modprobe <kernel_object>

Project release version

927a34f

System architecture

ARM 32-bit (Raspberry Pi 32-bit)

Operating system

Linux

Operating system version

6.1.28 (Mickledore) stm32-linux

Shell

Bash

Additional context

No response

@mantriyogesh
Copy link
Collaborator

@kapilkedawat ++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants