On Thu, Aug 17, 2023 at 4:22 PM Luca Giambonini <gluc...@gmail.com> wrote:

> Hi, I'm new to NuttX and I'm intrigued by its structure and philosophy. I'm
> currently testing it on the STM32L4R9AI-DISCO board, where I've been able
> to get the console and some LEDs working. I'd now like to use the Flash,
> which is a Macronix MX25LM51245GX connected to the microcontroller via an
> octo SPI interface. Looking at nuttx I saw that:
> - octospi is not implemented, only quadspi
> - this Macronix memory is not implemented in MTD
>
> Is it correct that octospi is not available? Are there any alternatives
> that I can use?
>
> If I would like to create a merge request to implement octospi, what is the
> correct procedure? For example, would I need to:
> 1) create a octospi_flash.c under drivers/spi
> 2) extend the mx25lx.c functions
>
> Thank you
> Luca




Hi Luca,

Lup has written a very good article about how to prepare pull requests for
the NuttX repository, which will be helpful if you would like to implement
octo SPI support.

Article:
https://lupyuen.github.io/articles/pr

It would probably be helpful to study the quad SPI and see how that is
implemented, and then either extend the implementation or use it as a
template to implement octo SPI. They probably aren't that different, right?
Just more bits moving in parallel.

A discussion about the structure of drivers and architectural code will be
helpful as well. NuttX uses a split approach where the "upper half" driver,
the one applications interface with, appears like a POSIX device that can
be opened/closed and accessed with read, write, and ioctl calls, while the
"lower half" driver is implemented for each microcontroller and handles the
low-level details of register-stuffing and whatnot. The upper half driver
is more or less easy to implement by following along with a similar driver.
The lower half driver is more involved because you have to look at the
microcontroller datasheet and setup and control the necessary peripherals
by programming their various registers.

There's some documentation about drivers and the upper/lower half here:
https://nuttx.apache.org/docs/latest/components/drivers/index.html

Hope this helps,
Nathan

Reply via email to