Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added raw QSPI functionality for the Arduino Giga#224

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cristidragomir97 wants to merge1 commit intoarduino:main
base:main
Choose a base branch
Loading
fromcristidragomir97:main

Conversation

@cristidragomir97
Copy link

  • Device Tree Configuration (variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.overlay):

    • Added complete QSPI flash device tree node configuration
    • Configured QuadSPI controller with proper pinctrl mappings:
      • Clock:pf10
      • CS:pg6
      • IO0-IO3:pd11,pd12,pe2,pf6
    • Addedqspi_flash device node with:
      • Compatible:st,stm32-qspi-nor
      • Size: 128 Mbits (16 MB)
      • Max frequency: 72 MHz
      • Bus width: 4 (quad mode)
  • Board Configuration (variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf):

    • Enabled QSPI flash support (previously commented out)
    • Added configuration options:
      • CONFIG_FLASH=y
      • CONFIG_FLASH_STM32_QSPI=y (corrected from invalidCONFIG_SPI_STM32_QSPI)
      • CONFIG_FLASH_MAP=y
      • CONFIG_FLASH_PAGE_LAYOUT=y
  • Library (libraries/QSPI)

    • bool begin() - Initialize QSPI flash
    • bool read(uint32_t address, void* data, size_t size) - Read data
    • bool write(uint32_t address, const void* data, size_t size) - Write data
    • bool erase(uint32_t address, size_t size) - Erase sector/block
    • size_t getFlashSize() - Get total flash size
    • size_t getSectorSize() - Get erase sector size
    • size_t getPageSize() - Get write page size
    • bool isReady() - Check if flash is ready
    • bool isValidAddress(uint32_t address, size_t size) - Validate address range
    • void end() - Deinitialize
  • ** Example Sketch**('libraries/QSPI/examples')
    Initialises flash storage, erases sectors, reads and writes in a loop.

Copy link

@pillo79pillo79 left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks, a few remarks below. But on a more general note, why did you need any of the changes in the Giga variant folder? The only thing I think was required was defining a genericqspi_flash, but it can be done with a simple one-liner:

qspi_flash: &n25q128a1 {};

everything else should be already set up in the upstream board. Can you double check please?

- Get flash information (size, sector size, page size)


### Device Tree Setup

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure the following part is relevant for Arduino users, only a selected few know about any of this 🙂
Maybe you can move this info to a more specific file, such asREADME.zephyr.md?

#define QSPI_FLASH_DEVICE DEVICE_DT_GET(QSPI_FLASH_NODE)
#else
#define QSPI_FLASH_DEVICE NULL
#warning "QSPI flash device not found in device tree"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
#warning "QSPI flashdevice not found in device tree"
#warning "NoQSPI flashavailable on this board"

flash_dev = QSPI_FLASH_DEVICE;

if (!device_is_ready(flash_dev)) {
flash_dev = nullptr;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Use eitherNULL ornullptr in the file for consistency.

return false;
}

return device_is_ready(flash_dev);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This does not verify the device can accept more commands, but simply that it's enabled and has passedinit(). Since this is already tested inbegin, IMO it's better toreturn true here.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pillo79pillo79pillo79 left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@cristidragomir97@pillo79

[8]ページ先頭

©2009-2025 Movatter.jp