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
boards: arm: use QSPI on XIAO BLE Sense #55199
Conversation
@oryjkov Please squash your changes to a single commit. |
Done. Thanks for the review |
@oryjkov Please add commit body according to contribution guidelines: https://docs.zephyrproject.org/3.3.0/contribute/guidelines.html#commit-message-guidelines |
@oryjkov Please update commit author to match your signed-off line. You can probably do this with |
The external flash chip is wired for QSPI. The chip, P25Q16H, has its "Quad enable" bit in bit 9 of the Read Status Register (section 10.5 in the datasheet), hence needs this particular quad enable requirement. Co-authored-by: Marcin Niestroj <m.niestroj@emb.dev> Signed-off-by: Oleg Ryjkov <oryjkov@gmail.com>
Dang, thanks. I haven't set it git config properly on this machine yet. |
Actually I want to hold this off for now. I tried doing system off with the qspi config and it fails: It works OK when used with SPI. Not sure what's up. LMK if you have any ideas. |
Hm, removing "has-dpd;" and friends is one way to go. SPI mode does not use them anyway and does not do deep power-down, so this won't be a regression. Later edit: The reason for saying that SPI mode is not doing power down is because when stepping through with debugger, I'm seeing that device p25q16h_spi in pm_device_action_run() at https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/pm/device.c#L44 has pm=NULL. Whereas when it runs as QSPI pm is not null. I have not actually verified whether flash is off with a power meter. |
I had another look and hopefully someone here could tell me what's the problem. This change as it is now works fine, however if I enter system off and then wake up (without losing power, so flash does not reset), then the flash device p25q16h@0 becomes unusable. Power cycling fixes it up again. I believe this is because the nrf driver can't get the flash chip out of deep sleep. Here is what I tried:
(All of this was using ncs-2.3.0-rc1, I have not tried the latest zephyr) I'd appreciate any help :) @mniestroj given that the driver now has dpd options. How certain are you that it actually puts the chip into deep sleep? |
Looking at the
Tested it with |
You're right. With SPI mode and IDLE_IN_DPD option enabled the current in SYSTEM_OFF was down to <4 uA. Without IDLE_IN_DPD - it was around 320 uA. Interestingly, flash itself is only 20uA, 300 seem to come from the fact that CS pin was driven high. Anyways, with QSPI without deep sleep it is possible to bring system off current down to ~25 uA. With deeps sleep it goes down to the same 4uA, but it won't resume. So it still feels like a regression. What do you think is the best course of action to get someone from Nordic to look at this, I'm guessing a DevZone ticket? |
@anangl @carlescufi could advice on above comment? |
@oryjkov Please create a Zephyr issue for this. |
Tested by running usb/mass demo on a XIAO ble board.
@mniestroj