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 2021/02/09 09:56:41 UTC

[GitHub] [incubator-nuttx] cwespressif opened a new pull request #2832: xtensa/esp32: Fix the issue of wifi internal malloc from psram

cwespressif opened a new pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832


   ## Summary
   
   `SPIRAM` is not DMA-capable, while WiFi `internal malloc` from heap must be DMA-capable, We must avoid `internal malloc` from the heap of `PSRAM`
   
   ## Impact
   
   If WiFi `internal malloc` from `PSRAM`, it will cause the system block.
   
   ## Testing
   
   ESP32
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r582715726



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       Yes, as the heap management of NuttX and esp-idf is too different, this part of the modification is too big, now temporarily free the given `ptr` in case of error.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r582656466



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,25 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *p = NULL;
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      kmm_free(ptr);
+      return NULL;
+    }
+
+  p = kmm_realloc(ptr, size);
+  if (esp32_ptr_extram(ptr))

Review comment:
       It's ptr, sorry for the mistake.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573495198



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       No, they are the same concepts, both means internal memory, I just have referred to the above @gustavonihei suggestion,   it's OK to use XTENSA_IMEM_USE_SEPARATE_HEAP




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r585110911



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3473,35 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *old_ptr = ptr;
+  void *new_ptr = NULL;
+  size_t old_size = 0;
+  if (size == 0 || esp32_ptr_extram(old_ptr))

Review comment:
       for `size == 0` case, you should free `ptr`.
   
   i don't think you need to check esp32_ptr_extram(old_ptr). the old_ptr will be freed on successful realloc anyway.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r583431933



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       @yamt The library will check `ptr` and then free it, there is a risk of double-free and I also think the above code instead of kmm_realloc is more reasonable, I have modified it, thank you.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#issuecomment-785494939


   > @cwespressif is everything done? May we merge it now?
   
   @acassis I think it's OK, but I still need to wait to see if @yamt  has any comments or suggestions ?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#issuecomment-785299931


   @cwespressif is everything done? May we merge it now?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573421300



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,9 +128,17 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_REGION_SIZE_MAX

Review comment:
       Agree, thanks for your comments, I have corrected it.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r583403458



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       but doesn't it cause double-free sooner or later, as the library would think the `ptr` still needs to be freed?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r582656732



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,25 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *p = NULL;
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      kmm_free(ptr);
+      return NULL;
+    }
+
+  p = kmm_realloc(ptr, size);
+  if (esp32_ptr_extram(ptr))

Review comment:
       It's `p`, sorry for the mistake.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r579907607



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +143,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+  *heap_size = HEAP_REGION_OFFSET;
+  *heap_start = (size_t)(HEAP_REGION1_END - *heap_size);

Review comment:
       what's this size_t cast for?
   

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;
+    }
+
   return kmm_realloc(ptr, size);

Review comment:
       i guess you want to check esp32_ptr_extram on the result of kmm_realloc.
   

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       * size == 0 case is better to be left to kmm_realloc
   * standard realloc is supposed to preserve the old memory in case of a failure. does this wifi_osi_funcs_t variant have a different semantics?
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573502159



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       it's better to be consistent at least within Kconfig. this seems like the only place IMM is used. @gustavonihei how do you think?
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r572948095



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +132,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_REGION_SIZE_MAX
+  *heap_size = 0x2000;

Review comment:
       hi @cwespressif please avoid using this hard-coded value (0x2000). Please create a macro symbol to represent this value. This value is used in more than one place, then defining it will simplify case someone want to modify it. Other (better) option is adding it as an option config and setup the minimum and maximum range the user can choose.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r580085605



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +143,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+  *heap_size = HEAP_REGION_OFFSET;
+  *heap_start = (size_t)(HEAP_REGION1_END - *heap_size);

Review comment:
       Hi @yamt  Just to reserve part of the heap memory of `region 1` for the NuttX system, because I found that if `region 1` is all used as the internal heap, there will be issue with the NuttX initialization or Wi-Fi connection process.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573639007



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       Yes, let's please use the same abbreviation everywhere.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573420348



##########
File path: arch/xtensa/src/esp32/esp32_imm.c
##########
@@ -73,6 +73,46 @@ FAR void *xtensa_imm_malloc(size_t size)
   return mm_malloc(&g_iheap, size);
 }
 
+/****************************************************************************
+ * Name: xtensa_imm_calloc
+ *
+ * Description:
+ *   Calculates the size of the allocation and
+ *   allocate memory the internal heap.
+ *
+ ****************************************************************************/
+
+FAR void *xtensa_imm_calloc(size_t n, size_t elem_size)
+{
+  return mm_calloc(&g_iheap, n, elem_size);
+}
+
+/****************************************************************************
+ * Name: xtensa_imm_realloc
+ *
+ * Description:
+ *   Reallocate memory from the internal heap.
+ *
+ ****************************************************************************/
+
+FAR void *xtensa_imm_realloc(void *ptr, size_t size)

Review comment:
       @acassis  I have modified it,  thank you.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r580116537



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;
+    }
+
   return kmm_realloc(ptr, size);

Review comment:
       `kmm_realloc ` also needs to be checked by `esp32_ptr_extram`, I have modified it, thank you for your reminder.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r582625635



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,25 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *p = NULL;
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      kmm_free(ptr);
+      return NULL;
+    }
+
+  p = kmm_realloc(ptr, size);
+  if (esp32_ptr_extram(ptr))

Review comment:
       do you mean `p`, not `ptr`?

##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +143,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+  *heap_size = HEAP_REGION_OFFSET;
+  *heap_start = (size_t)(HEAP_REGION1_END - *heap_size);

Review comment:
       my question was "(size_t)". if it was "(FAR void *)", i can understand.
   does this even compile without warnings?
   

##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       the esp-idf implementation does not seem to free the given `ptr` in case of error.
   eg. https://github.com/espressif/esp-idf/blob/master/components/heap/heap_caps.c#L323-L327
   it matches my expectation for realloc().
   i guess this implementation should do the same.
   unfortunately it seems ~impossible to implement it for !CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP case though.
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573420702



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +132,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_REGION_SIZE_MAX
+  *heap_size = 0x2000;

Review comment:
       Thanks for your suggestion, I have modified it.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r580091382



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;
+    }
+
   return kmm_realloc(ptr, size);

Review comment:
       I want to make sure that the old memory pointer is not in external RAM (PSRAM), although this is unlikely to happen.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r580089385



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       The size == 0 case means that the size of the new malloc is 0,
   In the esp_realloc_internal processing of wifi_osi_funcs_t, you can refer to:
   https://github.com/espressif/esp-idf/blob/master/components/heap/heap_caps.c#L318-L321




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r578740088



##########
File path: arch/xtensa/src/esp32/esp32_imm.c
##########
@@ -31,7 +31,31 @@
 
 #include "xtensa.h"
 
-#if CONFIG_XTENSA_USE_SEPARATE_IMEM
+#if CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP

Review comment:
       ```suggestion
   #ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r572954028



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,9 +128,17 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_REGION_SIZE_MAX
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_USE_SEPARATE_IMEM

Review comment:
       Another suggestion: the `XTENSA_USE_SEPARATE_IMEM` should explicitly inform that it intends to use a separate heap region (e.g.: `XTENSA_IMM_USE_SEPARATE_HEAP`)

##########
File path: arch/xtensa/Kconfig
##########
@@ -128,9 +128,17 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_REGION_SIZE_MAX

Review comment:
       Although `XTENSA_IMEM_REGION_SIZE_MAX` and `XTENSA_IMEM_REGION_SIZE` share similar names, they refer to different aspects of the memory.
   `XTENSA_IMEM_REGION_SIZE` refers to the **DRAM** region size, while `XTENSA_IMEM_REGION_SIZE_MAX` refers just to the heap region.
   Furthermore, I suggest to rename `XTENSA_IMEM_REGION_SIZE_MAX` to `XTENSA_IMEM_MAXIMIZE_HEAP_REGION`, so it becomes more adequate to a **bool** config, which intends to specify an action.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r580091382



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;
+    }
+
   return kmm_realloc(ptr, size);

Review comment:
       Yes, I want to make sure that the old memory pointer is not in external RAM (PSRAM), although this is unlikely to happen.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r578067799



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r578067657



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -102,12 +104,23 @@
 #  define HEAP_REGION2_START  0x3ffe7e40
 #endif
 
-#ifdef CONFIG_XTENSA_USE_SEPARATE_IMEM
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
 #define	XTENSA_IMEM_REGION_SIZE	CONFIG_XTENSA_IMEM_REGION_SIZE
 #else
 #define	XTENSA_IMEM_REGION_SIZE	0
 #endif
 
+/* If define CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION, it means

Review comment:
       Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r582674251



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -130,6 +143,10 @@
 void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
 {
   board_autoled_on(LED_HEAPALLOCATE);
+#ifdef CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+  *heap_size = HEAP_REGION_OFFSET;
+  *heap_start = (size_t)(HEAP_REGION1_END - *heap_size);

Review comment:
       Got it, I have modified.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573480357



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       are IMM and IMEM separate concepts?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r578860389



##########
File path: arch/xtensa/src/esp32/esp32_imm.c
##########
@@ -31,7 +31,31 @@
 
 #include "xtensa.h"
 
-#if CONFIG_XTENSA_USE_SEPARATE_IMEM
+#if CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP

Review comment:
       Done, thank you.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r572880126



##########
File path: arch/xtensa/src/esp32/esp32_imm.c
##########
@@ -73,6 +73,46 @@ FAR void *xtensa_imm_malloc(size_t size)
   return mm_malloc(&g_iheap, size);
 }
 
+/****************************************************************************
+ * Name: xtensa_imm_calloc
+ *
+ * Description:
+ *   Calculates the size of the allocation and
+ *   allocate memory the internal heap.
+ *
+ ****************************************************************************/
+
+FAR void *xtensa_imm_calloc(size_t n, size_t elem_size)
+{
+  return mm_calloc(&g_iheap, n, elem_size);
+}
+
+/****************************************************************************
+ * Name: xtensa_imm_realloc
+ *
+ * Description:
+ *   Reallocate memory from the internal heap.
+ *
+ ****************************************************************************/
+
+FAR void *xtensa_imm_realloc(void *ptr, size_t size)

Review comment:
       please change to: "FAR void *ptr"
   Note that the use of FAR is not required inside arch/ and boards/ directories. It is used only on generic code that will be used by all architectures




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r583406885



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3469,17 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  if (size == 0 || esp32_ptr_extram(ptr))
+    {
+      esp_free(ptr);
+      return NULL;

Review comment:
       maybe you can do something like the following instead of kmm_realloc. how do you think?
   ```
   new_ptr = kmm_malloc(new_size);
   if (esp32_ptr_extram(new_ptr)) {
       kmm_free(new_ptr);
       return NULL;
   }
   old_size = malloc_usable_size(old_ptr);
   memcpy(new_ptr, old_ptr, min(old_size, new_size));
   kmm_free(old_ptr);
   return new_ptr
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 commented on pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#issuecomment-787845221


   @yamt do you have any more concerns? 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r585205319



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3473,35 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *old_ptr = ptr;
+  void *new_ptr = NULL;
+  size_t old_size = 0;
+  if (size == 0 || esp32_ptr_extram(old_ptr))

Review comment:
       Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573666078



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,15 +128,23 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_MAXIMIZE_HEAP_REGION
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP
+	help
+		This separate heap will be part of the internal DRAM.  It starts right after .data
+		and ends at the (HEAP_REGION1_END - HEAP_REGION_OFFSET).
+
 config XTENSA_IMEM_REGION_SIZE
 	hex "DRAM region size for internal use"
-	depends on XTENSA_USE_SEPARATE_IMEM
+	depends on XTENSA_IMM_USE_SEPARATE_HEAP && !XTENSA_IMEM_MAXIMIZE_HEAP_REGION

Review comment:
       I agree, it really improves the consistency.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573667246



##########
File path: arch/xtensa/src/esp32/esp32_allocateheap.c
##########
@@ -102,12 +104,23 @@
 #  define HEAP_REGION2_START  0x3ffe7e40
 #endif
 
-#ifdef CONFIG_XTENSA_USE_SEPARATE_IMEM
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
 #define	XTENSA_IMEM_REGION_SIZE	CONFIG_XTENSA_IMEM_REGION_SIZE
 #else
 #define	XTENSA_IMEM_REGION_SIZE	0
 #endif
 
+/* If define CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION, it means

Review comment:
       ```suggestion
   /* If CONFIG_XTENSA_IMEM_MAXIMIZE_HEAP_REGION is defined, it means
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-nuttx] cwespressif commented on a change in pull request #2832: xtensa/esp32: Fix the issue of WiFi internal malloc from PSRAM

Posted by GitBox <gi...@apache.org>.
cwespressif commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r573421825



##########
File path: arch/xtensa/Kconfig
##########
@@ -128,9 +128,17 @@ config XTENSA_USE_SEPARATE_IMEM
 		This separate heap will be part of the internal DRAM.  It starts right after .data
 		and ends at the configurable size given by the OPTION XTENSA_IMEM_REGION_SIZE.
 
+config XTENSA_IMEM_REGION_SIZE_MAX
+	bool "Use a maximum separate heap for internal memory"
+	default n
+	depends on XTENSA_USE_SEPARATE_IMEM

Review comment:
       Good suggestion, it is easier to understand, I have modified.




----------------------------------------------------------------
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:
users@infra.apache.org