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

Wiseconnect 3.4 #12

Draft
wants to merge 20 commits into
base: silabs
Choose a base branch
from

Conversation

jerome-pouiller
Copy link
Collaborator

@jerome-pouiller jerome-pouiller commented Dec 3, 2024

In addition to the use of the last version of WiseConnect. I split the change I made on Wiseconnect in atomic patches. I hope some of these could be included in the upstream.

Upgrading Wiseconnect is a tedious task. This new script simplifies
upgrade and track of changes between the upstream and the HAL.

Signed-off-by: Jérôme Pouiller <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
Zephyr CI raise errors for misspelled words. So, the Zephyr code uses
"EXTENSION" while HAL still use "EXTENTION".

Signed-off-by: Jérôme Pouiller <[email protected]>
Wiseconnect provides its own version (and its own definitions) of
socket.h. These conflict with the ones provided by Zephyr. So, change
Wiseconnect to use the Zephyr socket definition.

Signed-off-by: Jérôme Pouiller <[email protected]>
Zephyr also export its version of fd_set. The two definitions are
incompatible.

This patch can be partly automated with:

    sed -i -e 's/\bFD_/SL_SI91X_FD_/' -e 's/\bfd_set/sl_si91x_fd_set/' **/*.[ch]

Signed-off-by: Jérôme Pouiller <[email protected]>
Wiseconnect define the "ETHERNET" macro. This causes failures during
Zephyr compilation. However "ETHERNET" symbol is not use by Wiseconnect,
so it can be safely removed.

Signed-off-by: Jérôme Pouiller <[email protected]>
ROUND_UP() is also defined in Zephyr. However, it is not referenced by
Wiseconnect. So we can safely drop it.

Signed-off-by: Jérôme Pouiller <[email protected]>
MIN() is also defined in Zephyr with the same definition.

Signed-off-by: Jérôme Pouiller <[email protected]>
IS_POWER_OF_TWO() is also defined in Zephyr with the same definition.

Signed-off-by: Jérôme Pouiller <[email protected]>
sl_component_catalog.h should be included only if
SL_COMPONENT_CATALOG_PRESENT is set.

Signed-off-by: Jérôme Pouiller <[email protected]>
Wiseconnect relies on an extension of CMSIS API to store the status of
the firmware. This API does not exist on Zephyr. Fortunately, the
firmware status is never read. So we can drop this code without breaking
anything.

Signed-off-by: Jérôme Pouiller <[email protected]>
Wiseconnect has been original developed for FreeRTOS.
sl_si91x_trigger_sleep() directly relies of FreeRTOS services. This
function does not compile. However, it is never called and can be safely
removed.

Signed-off-by: Jérôme Pouiller <[email protected]>
configTICK_RATE_HZ is specific to Wiseconnect. Equivalent in Zephyr is
CONFIG_SYS_CLOCK_TICKS_PER_SEC.

Note usually, configTICK_RATE_HZ == 1000 while
CONFIG_SYS_CLOCK_TICKS_PER_SEC == 1024.

Signed-off-by: Jérôme Pouiller <[email protected]>
Nothing from os_tick.h was used.

Signed-off-by: Jérôme Pouiller <[email protected]>
Compiler complain with:
    .../modules/hal/silabs/wiseconnect/components/device/silabs/si91x/wireless/asynchronous_socket/src/sl_si91x_socket.c: In function 'sli_si91x_accept_async':
    .../modules/hal/silabs/wiseconnect/components/device/silabs/si91x/wireless/asynchronous_socket/src/sl_si91x_socket.c:243:5: error: implicit declaration of function 'close'; did you mean 'fclose'? [-Werror=implicit-function-declaration]
      243 |     close(client_socket_id);
          |     ^~~~~
          |     fclose

close() is indeed declared in the BSD socket abstraction provided by
Wiseconnect:

    int close(int socket_id)
    {
      errno = 0; // Clear any existing error
      return sli_si91x_shutdown(socket_id, SHUTDOWN_BY_ID);
    }

To avoid any confusion between BSD sockets and Wiseconnect API, this
patch just call the underlying function (sli_si91x_shutdown()) instead
of close().

Signed-off-by: Jérôme Pouiller <[email protected]>
Wiseconnect allows to use an alternative clock if the temperature during
the start up is too high. However:
  - this feature relies on ADC and we don't want to import it for now
  - this kind of magic feature should be exposed to the user rather than
    hidden in the HAL (especially since use can also use ADC hardware)

Signed-off-by: Jérôme Pouiller <[email protected]>
ble_config.h is expected to contain the specific configuration for the
board. However, this does not fit very well with Zephyr board
definitions.

In the other hand, rsi_bt_common_config.h mostly contains all the
necessary definition. This patch just add a few missing definition.
These definitions are more or less arbitrary and we hope it will fit all
the use cases.

Signed-off-by: Jérôme Pouiller <[email protected]>
sl_strlen() and sl_strnlen() can be safely replaced by Posix
equivalents.

Signed-off-by: Jérôme Pouiller <[email protected]>
Zephyr linker script does not define .common_ipmu_ram section. This
reverts the change introduced on Wiseconnect 3.4

Signed-off-by: Jérôme Pouiller <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant