Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pillo79 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| #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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
Device Tree Configuration (
variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.overlay):pf10pg6pd11,pd12,pe2,pf6qspi_flashdevice node with:st,stm32-qspi-norBoard Configuration (
variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf):CONFIG_FLASH=yCONFIG_FLASH_STM32_QSPI=y(corrected from invalidCONFIG_SPI_STM32_QSPI)CONFIG_FLASH_MAP=yCONFIG_FLASH_PAGE_LAYOUT=yLibrary (
libraries/QSPI)bool begin()- Initialize QSPI flashbool read(uint32_t address, void* data, size_t size)- Read databool write(uint32_t address, const void* data, size_t size)- Write databool erase(uint32_t address, size_t size)- Erase sector/blocksize_t getFlashSize()- Get total flash sizesize_t getSectorSize()- Get erase sector sizesize_t getPageSize()- Get write page sizebool isReady()- Check if flash is readybool isValidAddress(uint32_t address, size_t size)- Validate address rangevoid end()- Deinitialize** Example Sketch**('libraries/QSPI/examples')
Initialises flash storage, erases sectors, reads and writes in a loop.