antmerlino commented on a change in pull request #3834:
URL: https://github.com/apache/incubator-nuttx/pull/3834#discussion_r644879328



##########
File path: include/nuttx/progmem.h
##########
@@ -49,96 +49,119 @@ extern "C"
  * Public Functions Definitions
  ****************************************************************************/
 
+/* NOTE: Since vendors use the terms page, block, and sector interchangably,
+ * it causes confusion and therefore a neutral term is used. We use the term
+ * "index" to refer to the ordinal number of erasable units of memory.
+ */
+
 /****************************************************************************
- * Name: up_progmem_neraseblocks
+ * Name: up_progmem_maxeraseindex
  *
  * Description:
- *   Return number of erase blocks
+ *   Return the total number of erasable units of memory.

Review comment:
       @davids5 Could this even fail? I suppose 0 means that there are no 
programmable units of memory?

##########
File path: include/nuttx/progmem.h
##########
@@ -147,48 +170,50 @@ size_t up_progmem_getaddress(size_t page);
  *
  ****************************************************************************/
 
-ssize_t up_progmem_eraseblock(size_t block);
+ssize_t up_progmem_erase(size_t index);
 
 /****************************************************************************
- * Name: up_progmem_ispageerased
+ * Name: up_progmem_issectionerased
  *
  * Description:
- *   Checks whether erase page is erased
+ *   Checks whether a specified unit of memory is erased
  *
  * Input Parameters:
- *   page - The page index to be checked.
+ *   index - ordinal number of the set of erasable units of memory
  *
  * Returned Value:
  *   Returns number of bytes NOT erased or negative value on error. If it
- *   returns zero then complete page is erased.
+ *   returns zero then complete section is erased.
  *
  *   The following errors are reported:
- *     -EFAULT: On invalid page
+ *     -EFAULT: On invalid index
  *
  ****************************************************************************/
 
-ssize_t up_progmem_ispageerased(size_t page);
+ssize_t up_progmem_iserased(size_t index);
 
 /****************************************************************************
  * Name: up_progmem_write
  *
  * Description:
  *   Program data at given address
  *
- *   Note: this function is not limited to single page and nor it requires
- *   the address be aligned inside the page boundaries.
+ *   Note: This function may cross memory boundaries so long as the caller
+ *         has ensured all units of memory that will be programmed have been
+ *         erased. It also does not require that the write be aligned with the
+ *         beginning of a unit of memory.
  *
  * Input Parameters:
  *   addr  - Address with or without flash offset
- *           (absolute or aligned to page0)
+ *           (absolute or aligned to sector0)

Review comment:
       @davids5 I believe I have addressed all of your comments except this 
one. The up_progmem_getaddress() interface could be used to get the base 
addresses of memory. Is this not sufficient? Or perhaps I don't understand your 
concern fully.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to