zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.71k stars 6.54k forks source link

spi_dw driver bug #77773

Closed ruiyinghou closed 1 month ago

ruiyinghou commented 1 month ago

Describe the bug

There is a bug in the api dw.c file that is missing the configuration of the ser register (Select a register from the device) , as follows: write_ser(dev, 1 << config->slave); This line of code should be added to line 260 of the spi dw config() function as follows:

if (!spi_dw_is_slave(spi)) {
        /* Baud rate and Slave select, for master only */
        write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency,
                            config->frequency));
        write_ser(dev, 1 << config->slave);
}

To Reproduce

Expected behavior

Impact

Logs and console output

Environment (please complete the following information):

Additional context

github-actions[bot] commented 1 month ago

Hi @ruiyinghou! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

henrikbrixandersen commented 1 month ago

You need to edit this issue to include the information requested in https://github.com/zephyrproject-rtos/zephyr/blob/main/.github/ISSUE_TEMPLATE/001_bug_report.md - leaving the fields blank doesn't help anyone.

tbursztyka commented 1 month ago

This is not a bug. See line 436. (and line 77 when everything is done).