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

CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN doesn't work in proj.conf #8327

Closed
mazhenke opened this issue Jun 12, 2018 · 3 comments
Closed

CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN doesn't work in proj.conf #8327

mazhenke opened this issue Jun 12, 2018 · 3 comments
Assignees
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@mazhenke
Copy link

In Kconfig.w25qxxdv file:

config SPI_FLASH_W25QXXDV_MAX_DATA_LEN
	int
	range 1 256
	default 256
	help
	  Maximum transmit or receive data length in one user data frame.

I want to change the CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN value in my project, so I add
CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN=32 in my proj.conf
but the CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN in
zephyr/include/generated/autoconf.h
is still 256, and I got the following cmake warning:

warning: SPI_FLASH_W25QXXDV_MAX_DATA_LEN (defined at drivers/flash/Kconfig.w25qxxdv:77) was assigned the value "32" but got the value "256" -- check dependencies

@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Jun 12, 2018
@ulfalizer
Copy link
Collaborator

ulfalizer commented Jun 12, 2018

@mazhenke
SPI_FLASH_W25QXXDV_MAX_DATA_LEN doesn't have a prompt, so it can't be set directly from a prj.conf file.

See http://docs.zephyrproject.org/porting/board_porting.html#setting-configuration-values for an overview of how to set symbols with and without prompts.

Currently a Kconfig.defconfig file would be needed to set the value, but only boards and SoCs can have Kconfig.defconfig, afaik. Maybe SPI_FLASH_W25QXXDV_MAX_DATA_LEN is supposed to be a fixed board setting, or there's a problem with how it is defined.

@tbursztyka touched this code recently. He might have some comments.

@tbursztyka
Copy link
Collaborator

tbursztyka commented Jun 13, 2018

Perhaps it can be removed (and code modified accordingly).
When I switched that driver to new spi API I got rid of this:
struct spi_flash_data { struct device *spi;
- u8_t buf[CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN + - W25QXXDV_LEN_CMD_ADDRESS];
`+ struct spi_config spi_cfg;

It looks like this length was only about internal buffer length, which is now useless due to new SPI API.
I'll verify that in the datasheet.

@tbursztyka
Copy link
Collaborator

yes it's a left-over. I'll remove that

@tbursztyka tbursztyka self-assigned this Jun 14, 2018
@tbursztyka tbursztyka added this to the v1.13.0 milestone Jun 14, 2018
@nashif nashif added priority: medium Medium impact/importance bug area: Flash labels Jun 14, 2018
tbursztyka pushed a commit to tbursztyka/zephyr that referenced this issue Jun 14, 2018
CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN is a left-over from old SPI API
usage. Now, there is no limit (besides the flash size) in SPI data
transaction.

Fixes zephyrproject-rtos#8327

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
nashif pushed a commit that referenced this issue Jun 14, 2018
CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN is a left-over from old SPI API
usage. Now, there is no limit (besides the flash size) in SPI data
transaction.

Fixes #8327

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants