nxfss on MT25Q nor flash
Does anyone have any pointers on how to setup nxfss (or any filesystem for that matter) on an MT25Q nor flash? I cannot find any code for any other boards that makes any sense to me and I feel this should be a pretty basic thing to want to do? I believe I have set up all the SPI stuff and now need to (auto)mount it in my bringup or app init code, but I'm stuck :( "CONFIG_HAVE_M25P" is as far as I have got. SAMA5D27 device. TIA, Tim.
Re: nxfss on MT25Q nor flash
Hi Tim, It seams like MT25Q uses the m25px.c driver, so I assume you are enabling the CONFIG_MT25Q_MEMORY_TYPE right? Next you need to configure our board SPI CS pin, please take a look at: arm/stm32/mikroe-stm32f4/src/stm32_spi.c Then before try to setup the NXFFS you need to confirm that the Flash NOR was detected correctly. BR, Alan On 8/24/21, Tim wrote: > Does anyone have any pointers on how to setup nxfss (or any filesystem for > that matter) on an MT25Q nor flash? > > > > I cannot find any code for any other boards that makes any sense to me and > I > feel this should be a pretty basic thing to want to do? I believe I have > set > up all the SPI stuff and now need to (auto)mount it in my bringup or app > init code, but I'm stuck :( > > > > "CONFIG_HAVE_M25P" is as far as I have got. > > > > SAMA5D27 device. > > > > TIA, > > > > Tim. > > > >
RE: nxfss on MT25Q nor flash
>From: Alan Carvalho de Assis > >It seams like MT25Q uses the m25px.c driver, so I assume you are enabling the >CONFIG_MT25Q_MEMORY_TYPE right? Yes = my .config has CONFIG_MT25Q_MEMORY_TYPE set > >Next you need to configure our board SPI CS pin, please take a look >at: arm/stm32/mikroe-stm32f4/src/stm32_spi.c > Yes, I have defined the PIOs etc. >Then before try to setup the NXFFS you need to confirm that the Flash NOR was >detected correctly. How, in code or from the nsh, do I do that? I know the chip works as I've used it (for example) for u-boot environment variables with no issue, but I can't find the way to either mount it, or "probe" it, or anything, from nuttx. It doesn’t appear as a /dev. No doubt it's in some documentation somewhere > >On 8/24/21, Tim wrote: >> Does anyone have any pointers on how to setup nxfss (or any filesystem >> for that matter) on an MT25Q nor flash? >> >> >> >> I cannot find any code for any other boards that makes any sense to me >> and I feel this should be a pretty basic thing to want to do? I >> believe I have set up all the SPI stuff and now need to (auto)mount it >> in my bringup or app init code, but I'm stuck :(
Re: nxfss on MT25Q nor flash
Hi Tim, On 8/24/21, Tim wrote: >>From: Alan Carvalho de Assis >> >>It seams like MT25Q uses the m25px.c driver, so I assume you are enabling >> the >>CONFIG_MT25Q_MEMORY_TYPE right? > > Yes = my .config has CONFIG_MT25Q_MEMORY_TYPE set > >> >>Next you need to configure our board SPI CS pin, please take a look >>at: arm/stm32/mikroe-stm32f4/src/stm32_spi.c >> > > Yes, I have defined the PIOs etc. > >>Then before try to setup the NXFFS you need to confirm that the Flash NOR >> was >>detected correctly. > > How, in code or from the nsh, do I do that? I know the chip works as I've > used it (for example) for u-boot environment variables with no issue, but I > can't find the way to either mount it, or "probe" it, or anything, from > nuttx. It doesn’t appear as a /dev. > > No doubt it's in some documentation somewhere > You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It will tell you want is going on. BR, Alan
RE: nxfss on MT25Q nor flash
Hi Alan, >Hi Tim, > >On 8/24/21, Tim wrote: >> >>>Then before try to setup the NXFFS you need to confirm that the Flash >>>NOR was detected correctly. >> >> How, in code or from the nsh, do I do that? I know the chip works as >> I've used it (for example) for u-boot environment variables with no >> issue, but I can't find the way to either mount it, or "probe" it, or >> anything, from nuttx. It doesn’t appear as a /dev. >> > >You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It will >tell you want is going on. > Yes, I have done that of course, but get no messages. I am sure this is simply because there is no code being called to register the driver as I can't find an example for any other boards that looks relevant :(
SPI EEPROM
The more time I spend with nuttx the more I think I just haven't found some treasure trove of documentation somewhere. All I seem to end up doing is searching every single file for some kind of clue as to what to do! I have an SPI EEPROM device. Menuconfig allows me to set it up, lovely! I end up with CONFIG_EEPROM=y CONFIG_SPI_EE_25XX=y (Also SPI mode and frequency). Now what.. If I search for either of those CONFIG parameters, the first is not referenced anywhere (apart from my .config), the second confirms that it will include spi_xx25xx.c as a source. Getting there.. It'll be ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname, int devtype, int readonly) I need to call - makes sense. Only there is no explanation, or examples of, how to make that call, and a Google search doesn't help either. Next step will be to look for examples of spi_dev_s and see if I can deduce it somehow. Just how am I supposed to know how to call that initialisation code? Which is why I started this question with the observation that surely I must be missing something somewhere!!?? Yes, it's a bit of a whinge, but also a request for help..please :)
Re: nxfss on MT25Q nor flash
Ok, did you open your System.map and searched for m25p_initialize() ? Few days ago I gave someone else this same tip (and another) and he got things working, please take a look on our email history. BR, Alan On 8/24/21, Tim wrote: > Hi Alan, > >>Hi Tim, >> >>On 8/24/21, Tim wrote: >>> Then before try to setup the NXFFS you need to confirm that the Flash NOR was detected correctly. >>> >>> How, in code or from the nsh, do I do that? I know the chip works as >>> I've used it (for example) for u-boot environment variables with no >>> issue, but I can't find the way to either mount it, or "probe" it, or >>> anything, from nuttx. It doesn’t appear as a /dev. >>> >> >>You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It >> will >>tell you want is going on. >> > Yes, I have done that of course, but get no messages. I am sure this is > simply because there is no code being called to register the driver as I > can't find an example for any other boards that looks relevant :( > >
Re: nxfss on MT25Q nor flash
> but I can't find the way to either mount it, or "probe" it, or anything, from nuttx. The sequence to initialise the flash and mount NXFFS should look like the following (to be adapted for chip and device): spi = stm32_spibus_initialize(1); if (!spi) { ferr("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } mtd = w25_initialize(spi); if (!mtd) { ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } ret = nxffs_initialize(mtd); if (ret < 0) { ferr("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } ret = nx_mount(NULL, "/mnt", "nxffs", 0, NULL); if (ret < 0) { ret = nx_mount(NULL, "/mnt", "nxffs", 0, "forceformat"); if (ret < 0) { ferr("ERROR: Failed to mount the FS volume: %d\n", errno); return ret; } } On Tue, Aug 24, 2021 at 6:39 PM Tim wrote: > Hi Alan, > > >Hi Tim, > > > >On 8/24/21, Tim wrote: > >> > >>>Then before try to setup the NXFFS you need to confirm that the Flash > >>>NOR was detected correctly. > >> > >> How, in code or from the nsh, do I do that? I know the chip works as > >> I've used it (for example) for u-boot environment variables with no > >> issue, but I can't find the way to either mount it, or "probe" it, or > >> anything, from nuttx. It doesn’t appear as a /dev. > >> > > > >You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It > will > >tell you want is going on. > > > Yes, I have done that of course, but get no messages. I am sure this is > simply because there is no code being called to register the driver as I > can't find an example for any other boards that looks relevant :( > >
Re: nxfss on MT25Q nor flash
BTW, do we have a driver for MT25Q? I can't see one. Is it compatible with the M25P series? On Tue, Aug 24, 2021 at 5:50 PM Abdelatif Guettouche < abdelatif.guettou...@gmail.com> wrote: > > but I can't find the way to either mount it, or "probe" it, or anything, > from nuttx. > > > The sequence to initialise the flash and mount NXFFS should look like the > following (to be adapted for chip and device): > > spi = stm32_spibus_initialize(1); > if (!spi) > { > ferr("ERROR: Failed to initialize SPI port 2\n"); > return -ENODEV; > } > > mtd = w25_initialize(spi); > if (!mtd) > { > ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH > driver\n"); > return -ENODEV; > } > > ret = nxffs_initialize(mtd); > if (ret < 0) > { > ferr("ERROR: NXFFS initialization failed: %d\n", -ret); > return ret; > } > > ret = nx_mount(NULL, "/mnt", "nxffs", 0, NULL); > if (ret < 0) >{ >ret = nx_mount(NULL, "/mnt", "nxffs", 0, "forceformat"); >if (ret < 0) > { > ferr("ERROR: Failed to mount the FS volume: %d\n", errno); > return ret; > } >} > > > On Tue, Aug 24, 2021 at 6:39 PM Tim wrote: > >> Hi Alan, >> >> >Hi Tim, >> > >> >On 8/24/21, Tim wrote: >> >> >> >>>Then before try to setup the NXFFS you need to confirm that the Flash >> >>>NOR was detected correctly. >> >> >> >> How, in code or from the nsh, do I do that? I know the chip works as >> >> I've used it (for example) for u-boot environment variables with no >> >> issue, but I can't find the way to either mount it, or "probe" it, or >> >> anything, from nuttx. It doesn’t appear as a /dev. >> >> >> > >> >You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It >> will >> >tell you want is going on. >> > >> Yes, I have done that of course, but get no messages. I am sure this is >> simply because there is no code being called to register the driver as I >> can't find an example for any other boards that looks relevant :( >> >>
RE: nxfss on MT25Q nor flash
No, it's not in the system map. Having now searched for it I see there's a possibly useful example in stm32_appinit.c so I will wade through that. How was I supposed to know what to look for!!?? >Ok, did you open your System.map and searched for m25p_initialize() ? > >Few days ago I gave someone else this same tip (and another) and he got things >working, please take a look on our email history. > >BR, > >Alan >
Re: SPI EEPROM
Hi Tim, You are right, Documentation is one of our "Achilles tendon". But, of course, some times it is also the user search fault, maybe they don't have the Google-fun skills yet (please don't take it as personal). If you search for NuttX EEPROM Tutorial It will returns this tutorial: https://www.youtube.com/watch?v=qzjf2JtgYN0 Please get us to improve this situation, write a tutorial at: nuttx/Documentation/guides/ about it. BR, Alan On 8/24/21, Tim wrote: > The more time I spend with nuttx the more I think I just haven't found some > treasure trove of documentation somewhere. All I seem to end up doing is > searching every single file for some kind of clue as to what to do! > > > > I have an SPI EEPROM device. Menuconfig allows me to set it up, lovely! I > end up with > > CONFIG_EEPROM=y > > CONFIG_SPI_EE_25XX=y > > > > (Also SPI mode and frequency). > > > > Now what.. > > > > If I search for either of those CONFIG parameters, the first is not > referenced anywhere (apart from my .config), the second confirms that it > will include spi_xx25xx.c as a source. Getting there.. > > > > It'll be ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname, > int > devtype, int readonly) I need to call - makes sense. > > > > Only there is no explanation, or examples of, how to make that call, and a > Google search doesn't help either. > > > > Next step will be to look for examples of spi_dev_s and see if I can deduce > it somehow. > > > > Just how am I supposed to know how to call that initialisation code? Which > is why I started this question with the observation that surely I must be > missing something somewhere!!?? > > > > Yes, it's a bit of a whinge, but also a request for help..please :) > >
Re: nxfss on MT25Q nor flash
Hi Tim, It is not your fault, it is fault to NuttX complexity. We need to improve it, I think NSH_ARCHINIT should be enabled by default. NuttX is full of unnecessary traps that let users to fall into all the time. BR, Alan On 8/24/21, Tim wrote: > No, it's not in the system map. Having now searched for it I see there's a > possibly useful example in stm32_appinit.c so I will wade through that. > > How was I supposed to know what to look for!!?? > >>Ok, did you open your System.map and searched for m25p_initialize() ? >> >>Few days ago I gave someone else this same tip (and another) and he got >> things >>working, please take a look on our email history. >> >>BR, >> >>Alan >> > >
Re: SPI EEPROM
That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it “just worked” ☹ From: Alan Carvalho de Assis Reply to: Date: Tuesday, 24 August 2021 at 18:01 To: Subject: Re: SPI EEPROM Hi Tim, You are right, Documentation is one of our "Achilles tendon". But, of course, some times it is also the user search fault, maybe they don't have the Google-fun skills yet (please don't take it as personal). If you search for NuttX EEPROM Tutorial It will returns this tutorial: https://www.youtube.com/watch?v=qzjf2JtgYN0 Please get us to improve this situation, write a tutorial at: nuttx/Documentation/guides/ about it. BR, Alan On 8/24/21, Tim wrote: The more time I spend with nuttx the more I think I just haven't found some treasure trove of documentation somewhere. All I seem to end up doing is searching every single file for some kind of clue as to what to do! I have an SPI EEPROM device. Menuconfig allows me to set it up, lovely! I end up with CONFIG_EEPROM=y CONFIG_SPI_EE_25XX=y (Also SPI mode and frequency). Now what.. If I search for either of those CONFIG parameters, the first is not referenced anywhere (apart from my .config), the second confirms that it will include spi_xx25xx.c as a source. Getting there.. It'll be ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname, int devtype, int readonly) I need to call - makes sense. Only there is no explanation, or examples of, how to make that call, and a Google search doesn't help either. Next step will be to look for examples of spi_dev_s and see if I can deduce it somehow. Just how am I supposed to know how to call that initialisation code? Which is why I started this question with the observation that surely I must be missing something somewhere!!?? Yes, it's a bit of a whinge, but also a request for help..please :)
Re: SPI EEPROM
Hi Tim, The process to get AT25 SPI is similar, but for SPI you need to get the CS pin configure besides the other four SPI pins. Is this your first time using SPI on NuttX? There are some tutorials at NuttX Channel explaining how to use SPI on NuttX, like using SDCard over SPI. I suggest you to start with a board that has everything in place already, like the STM32F4Discovery or BluePill (stm32f103-minimum). Also the guys from MicroROS wrote a more technical tutorial about how SPI works on NuttX: https://github.com/micro-ROS/NuttX/issues/29 There is not theoretical class of swimming, you need to enter in the water, just start in the shallow place: stm32 + sdcard spi for example. BR, Alan On 8/24/21, Tim Hardisty wrote: > That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it > “just worked” ☹ > > > > > > > > From: Alan Carvalho de Assis > Reply to: > Date: Tuesday, 24 August 2021 at 18:01 > To: > Subject: Re: SPI EEPROM > > > > Hi Tim, > > > > You are right, Documentation is one of our "Achilles tendon". > > > > But, of course, some times it is also the user search fault, maybe > > they don't have the Google-fun skills yet (please don't take it as > > personal). > > > > If you search for NuttX EEPROM Tutorial > > > > It will returns this tutorial: > > > > https://www.youtube.com/watch?v=qzjf2JtgYN0 > > > > Please get us to improve this situation, write a tutorial at: > > nuttx/Documentation/guides/ about it. > > > > BR, > > > > Alan > > > > On 8/24/21, Tim wrote: > > The more time I spend with nuttx the more I think I just haven't found some > > treasure trove of documentation somewhere. All I seem to end up doing is > > searching every single file for some kind of clue as to what to do! > > > > > > > > I have an SPI EEPROM device. Menuconfig allows me to set it up, lovely! I > > end up with > > > > CONFIG_EEPROM=y > > > > CONFIG_SPI_EE_25XX=y > > > > > > > > (Also SPI mode and frequency). > > > > > > > > Now what.. > > > > > > > > If I search for either of those CONFIG parameters, the first is not > > referenced anywhere (apart from my .config), the second confirms that it > > will include spi_xx25xx.c as a source. Getting there.. > > > > > > > > It'll be ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname, > > int > > devtype, int readonly) I need to call - makes sense. > > > > > > > > Only there is no explanation, or examples of, how to make that call, and a > > Google search doesn't help either. > > > > > > > > Next step will be to look for examples of spi_dev_s and see if I can deduce > > it somehow. > > > > > > > > Just how am I supposed to know how to call that initialisation code? Which > > is why I started this question with the observation that surely I must be > > missing something somewhere!!?? > > > > > > > > Yes, it's a bit of a whinge, but also a request for help..please :) > > > > > > > >
Re: SPI EEPROM
I have 3 different SAMA5D2 eval board and have used them for years. I have had my custom board running “bare metal” code based on the Atmel code with no problems. Everything works, including the many many custom device on the board. I can swim. Using Lvgl too. I made the decision to move to NuttX as I hoped it would make it easier to write the final app as I need USB host, USB device, and a file system. It feels, right now, like it was a bad move as the documentation is seemingly incomplete. There is no point me getting yet another eval board just to prove that boards that are already supported work. Or should work - the SAMA5 eval boards are “supported” but are full of errors (e.g. flexcom is based on SAMA5D3 which is different; SAMA5D2 has MCAN but the D3 has CAN and needs a completely different driver; and so on. PRs to follow!!). As I have found, even basic devices such as nor flash or SPI EEPROM have only minimal support and, more importantly, no documentation that’s worth using. I will just have to keep struggling, googling, grepping, and hoping to hit lucky. I will add to the documentation once I have it working. If I get it working. And this is not aimed at you, Alan, as I know you are trying hard to help. From: Alan Carvalho de Assis Reply to: Date: Tuesday, 24 August 2021 at 19:42 To: Subject: Re: SPI EEPROM Hi Tim, The process to get AT25 SPI is similar, but for SPI you need to get the CS pin configure besides the other four SPI pins. Is this your first time using SPI on NuttX? There are some tutorials at NuttX Channel explaining how to use SPI on NuttX, like using SDCard over SPI. I suggest you to start with a board that has everything in place already, like the STM32F4Discovery or BluePill (stm32f103-minimum). Also the guys from MicroROS wrote a more technical tutorial about how SPI works on NuttX: https://github.com/micro-ROS/NuttX/issues/29 There is not theoretical class of swimming, you need to enter in the water, just start in the shallow place: stm32 + sdcard spi for example. BR, Alan On 8/24/21, Tim Hardisty wrote: That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it “just worked” ☹ From: Alan Carvalho de Assis Reply to: Date: Tuesday, 24 August 2021 at 18:01 To: Subject: Re: SPI EEPROM Hi Tim, You are right, Documentation is one of our "Achilles tendon". But, of course, some times it is also the user search fault, maybe they don't have the Google-fun skills yet (please don't take it as personal). If you search for NuttX EEPROM Tutorial It will returns this tutorial: https://www.youtube.com/watch?v=qzjf2JtgYN0 Please get us to improve this situation, write a tutorial at: nuttx/Documentation/guides/ about it. BR, Alan On 8/24/21, Tim wrote: The more time I spend with nuttx the more I think I just haven't found some treasure trove of documentation somewhere. All I seem to end up doing is searching every single file for some kind of clue as to what to do! I have an SPI EEPROM device. Menuconfig allows me to set it up, lovely! I end up with CONFIG_EEPROM=y CONFIG_SPI_EE_25XX=y (Also SPI mode and frequency). Now what.. If I search for either of those CONFIG parameters, the first is not referenced anywhere (apart from my .config), the second confirms that it will include spi_xx25xx.c as a source. Getting there.. It'll be ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname, int devtype, int readonly) I need to call - makes sense. Only there is no explanation, or examples of, how to make that call, and a Google search doesn't help either. Next step will be to look for examples of spi_dev_s and see if I can deduce it somehow. Just how am I supposed to know how to call that initialisation code? Which is why I started this question with the observation that surely I must be missing something somewhere!!?? Yes, it's a bit of a whinge, but also a request for help..please :)
Re: SPI EEPROM
That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it “just worked” ☹ There is support for the AT24 in other SAM boards. Search for AT24 in defconfigs, I find boards/arm/samv7/same70-xplained/ boards/arm/samv7/samv71-xult/ boards/arm/xmc4/xmc4500-relax There is even simulated AT24 support: boars/sim/sim/sim You should be able to duplicate the logic from the samv7 boards.
Re: SPI EEPROM
AT24 is I2C and this is well supported in NuttX. AT25 is SPI and is what I have (AT25128) and it is not well supported, with no example code or boards that support it (that I can find) From: Gregory Nutt Reply to: Date: Tuesday, 24 August 2021 at 20:11 To: Subject: Re: SPI EEPROM That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it “just worked” ☹ There is support for the AT24 in other SAM boards. Search for AT24 in defconfigs, I find boards/arm/samv7/same70-xplained/ boards/arm/samv7/samv71-xult/ boards/arm/xmc4/xmc4500-relax There is even simulated AT24 support: boars/sim/sim/sim You should be able to duplicate the logic from the samv7 boards.
Re[2]: SPI EEPROM
Hi Tim, You could search for any spi device being initialized. Search for spi_dev_s being declared in boards folder for some board, use it as an example and do the same initialization. Vadim Sent from Mail.ru app for iOS Tuesday, August 24, 2021, 3:16 PM -0400 from t...@jti.uk.com.invalid : >AT24 is I2C and this is well supported in NuttX. AT25 is SPI and is what I >have (AT25128) and it is not well supported, with no example code or boards >that support it (that I can find) > > > > > > > > > >From: Gregory Nutt < spudan...@gmail.com > >Reply to: < dev@nuttx.apache.org > >Date: Tuesday, 24 August 2021 at 20:11 >To: < dev@nuttx.apache.org > >Subject: Re: SPI EEPROM > > > > > >That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it >“just worked” ☹ > > > >There is support for the AT24 in other SAM boards. Search for AT24 in > >defconfigs, I find > > > >boards/arm/samv7/same70-xplained/ > >boards/arm/samv7/samv71-xult/ > >boards/arm/xmc4/xmc4500-relax > > > >There is even simulated AT24 support: > > > >boars/sim/sim/sim > > > >You should be able to duplicate the logic from the samv7 boards. > > > > >
Re: Re[2]: SPI EEPROM
Thanks Vadim – that’s pretty much the conclusion I had come to. Tim. Subject: Re[2]: SPI EEPROM Hi Tim, You could search for any spi device being initialized. Search for spi_dev_s being declared in boards folder for some board, use it as an example and do the same initialization.
Re: SPI EEPROM
Hi Tim, It is very straightforward, basically you will replace: FAR struct i2c_master_s *i2c; i2c = stm32_i2cbus_initialize(AT24_I2C_BUS); mtd = at24c_initialize(i2c); WITH: FAR struct spi_dev_s *spi; spi = sam_spibus_initialize(AT25_SPI_PORTNO); mtd = at25_initialize(spi); But of course, if you don't know how to configure the SPI pins (including the GPIO pin CS), nothing will work. For Atmel/Microchip SAMxx family SPI, I think boards/arm/samv7/samv71-xult/src/sam_st7789.c could be a good reference. BR, Alan On 8/24/21, Tim Hardisty wrote: > AT24 is I2C and this is well supported in NuttX. AT25 is SPI and is what I > have (AT25128) and it is not well supported, with no example code or boards > that support it (that I can find) > > > > > > > > > > From: Gregory Nutt > Reply to: > Date: Tuesday, 24 August 2021 at 20:11 > To: > Subject: Re: SPI EEPROM > > > > > > That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it > “just worked” ☹ > > > > There is support for the AT24 in other SAM boards. Search for AT24 in > > defconfigs, I find > > > > boards/arm/samv7/same70-xplained/ > > boards/arm/samv7/samv71-xult/ > > boards/arm/xmc4/xmc4500-relax > > > > There is even simulated AT24 support: > > > > boars/sim/sim/sim > > > > You should be able to duplicate the logic from the samv7 boards. > > > > > >
Re: SPI EEPROM
Thanks Alan – all my SPI pins are configured. That was easy to work out :) I will follow this tomorrow and I’m sure it will all seem easier in the morning! From: Alan Carvalho de Assis Reply to: Date: Tuesday, 24 August 2021 at 20:59 To: Subject: Re: SPI EEPROM Hi Tim, It is very straightforward, basically you will replace: FAR struct i2c_master_s *i2c; i2c = stm32_i2cbus_initialize(AT24_I2C_BUS); mtd = at24c_initialize(i2c); WITH: FAR struct spi_dev_s *spi; spi = sam_spibus_initialize(AT25_SPI_PORTNO); mtd = at25_initialize(spi); But of course, if you don't know how to configure the SPI pins (including the GPIO pin CS), nothing will work. For Atmel/Microchip SAMxx family SPI, I think boards/arm/samv7/samv71-xult/src/sam_st7789.c could be a good reference. BR, Alan On 8/24/21, Tim Hardisty wrote: AT24 is I2C and this is well supported in NuttX. AT25 is SPI and is what I have (AT25128) and it is not well supported, with no example code or boards that support it (that I can find) From: Gregory Nutt Reply to: Date: Tuesday, 24 August 2021 at 20:11 To: Subject: Re: SPI EEPROM That’s AT24 I2C not AT25 SPI EEPROM unfortunatel, and from a quick look it “just worked” ☹ There is support for the AT24 in other SAM boards. Search for AT24 in defconfigs, I find boards/arm/samv7/same70-xplained/ boards/arm/samv7/samv71-xult/ boards/arm/xmc4/xmc4500-relax There is even simulated AT24 support: boars/sim/sim/sim You should be able to duplicate the logic from the samv7 boards.