You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/04 18:54:39 UTC

[GitHub] [incubator-nuttx] curuvar opened a new pull request, #6998: Added SMART filesystem to RP2040

curuvar opened a new pull request, #6998:
URL: https://github.com/apache/incubator-nuttx/pull/6998

   ## Summary
    
   This code implements a Sector Mapped Allocation for Really Tiny (SMART) filesystem in the RP2040 flash memory chip.  It uses the space not otherwise used by the NuttX binary and supports both read and write access.  The initial state if the filesystem can be set when a new program is uploaded to the RP2040.  Data subsequently written to the filesystem persists across re-boots.
   
   ## Impact
   
   This bulk of this request is RP2040 only, although a few common SMART filesystem source files were updated to correctly handle unaligned access.
   
   ## Testing
   
   This change has been tested on a RaspberryPi pico W. Data has been read and written by various NSH commands and the tests in smart_test work as expected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] acassis merged pull request #6998: Added SMART filesystem to RP2040

Posted by GitBox <gi...@apache.org>.
acassis merged PR #6998:
URL: https://github.com/apache/incubator-nuttx/pull/6998


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #6998: Added SMART filesystem to RP2040

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #6998:
URL: https://github.com/apache/incubator-nuttx/pull/6998#issuecomment-1272444006

   I think this PR should have been separated into several commits.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #6998: Added SMART filesystem to RP2040

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #6998:
URL: https://github.com/apache/incubator-nuttx/pull/6998#issuecomment-1272443471

   The following issue has been reported.
   https://github.com/apache/incubator-nuttx/issues/7233
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6998: Added SMART filesystem to RP2040

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6998:
URL: https://github.com/apache/incubator-nuttx/pull/6998#discussion_r962964317


##########
fs/smartfs/smartfs_smart.c:
##########
@@ -657,6 +675,18 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
 
   DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
 
+#ifdef CONFIG_DEBUG_FS_INFO
+  finfo("Writing %lu bytes:", (uint32_t)buflen);
+  for (uint32_t i = 0; i < buflen; ++i)
+    {
+      if ((i & 0x0f) == 0) printf("\n    ");
+
+      printf("%02x, ", buffer[i]);

Review Comment:
   kernel shouldn't call printf



##########
fs/smartfs/smartfs_smart.c:
##########
@@ -45,6 +45,10 @@
 
 #include "smartfs.h"
 
+#ifdef CONFIG_DEBUG_FS_INFO
+#  include <stdio.h>

Review Comment:
   remove, you can't call printf inside kernel



##########
fs/smartfs/smartfs_smart.c:
##########
@@ -528,6 +532,8 @@ static ssize_t smartfs_read(FAR struct file *filep, char *buffer,
 
   DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
 
+  finfo("Reading %u bytes\n", (unsigned) buflen);

Review Comment:
   ```
   finfo("Reading %zu bytes\n", buflen);
   ```
   



##########
fs/smartfs/smartfs_smart.c:
##########
@@ -941,6 +971,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
 
   ret = byteswritten;
 
+  finfo("Wrote %u bytes\n", (unsigned) byteswritten);

Review Comment:
   ```
   finfo("Reading %zu bytes\n", byteswritten);
   ```
   



##########
fs/smartfs/smartfs_smart.c:
##########
@@ -852,7 +882,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
           /* Copy the new sector to the old one and chain it */
 
           header = (struct smartfs_chain_header_s *) sf->buffer;
-          *((uint16_t *) header->nextsector) = (uint16_t) ret;
+          SMARTFS_SET_NEXTSECTOR(header, (uint16_t) ret);

Review Comment:
   let's move all cast to SMARTFS_SET_NEXTSECTOR macro



##########
fs/smartfs/smartfs_smart.c:
##########
@@ -633,6 +639,18 @@ static ssize_t smartfs_read(FAR struct file *filep, char *buffer,
 
   /* Return the number of bytes we read */
 
+#ifdef CONFIG_DEBUG_FS_INFO
+  finfo("Read %lu bytes:", bytesread);
+  for (uint32_t i = 0; i < bytesread; ++i)
+    {
+      if ((i & 0x0f) == 0) printf("\n    ");
+
+      printf("%02x, ", buffer[i]);

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org