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/06 18:30:16 UTC

[GitHub] [incubator-nuttx] curuvar opened a new pull request, #7021: Fix race condition in RaspberryPi Pico W WiFi and add "telnet" config

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

   ## Summary
   
   Added code to resolve a race condition when writing data to the Pico W's WiFi chip.
   Also added a "telnet" configuration that demonstrates basic networking.
   
   ## Impact
   
   No impact to other software.
   
   ## Testing
   
   Built and run on RaspberryPi Pico W.
   


-- 
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 #7021: Fix race condition in RaspberryPi Pico W WiFi

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


##########
arch/arm/src/rp2040/rp2040_cyw43439.c:
##########
@@ -54,6 +54,8 @@ bool  g_print_gspi = false;
 
 #define TX_FIFO_SIZE    4
 
+#define DMB()  asm volatile ("dmb" ::: "memory")

Review Comment:
   call ARM_DMB



-- 
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] pkarashchenko commented on a diff in pull request #7021: Fix race condition in RaspberryPi Pico W WiFi

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


##########
arch/arm/src/rp2040/rp2040_cyw43439.c:
##########
@@ -606,30 +632,35 @@ static int my_read(FAR struct gspi_dev_s  *gspi,
                      rp_io->pio_sm,
                      pio_encode_jmp(rp_io->pio_location));
 
-  /* Set the PIO X (tx bit len) and Y (rx bit len) registers.
+  /* Set the PIO X and Y registers.
+   *
+   * We load X (the TX bit length) with one less than the number of
+   * bits to transmit to the chip. Since we only send the 32-bit command
+   * word we set X to 31.
+   *
+   * We load Y with the number of bits to read.  This is based on the
+   * byte count in "length" which we round up to a 32-bit boundry so the
+   * pio program will be sure to autopush the final data to the output fifo.
+   *
    * This is slightly magical.  The way we load the X is to first
    * push the the number of bits to transmit onto the transmit fifo.
    * Then we force the PIO state machine to execute the instruction
    * "out x, 32" which transfers the word from the output shift
    * register (OSR) to the X register.  When this instruction executes
-   * the PIO will notice the the OSR is empty, so will automatically
+   * the PIO will notice that the OSR is empty, so will automatically
    * pull a value (the one we just added) from the input fifo.
    *
-   * Loading the Y works the same way, except we round the number of
-   * bits up to a multiple of 32, so the pio program will be sure to
-   * autopush the final data to the output fifo.
+   * Loading the Y works the same way.
    */
 
   rp2040_pio_sm_put(rp_io->pio, rp_io->pio_sm, 31);
   rp2040_pio_sm_exec(rp_io->pio, rp_io->pio_sm, pio_encode_out(pio_x, 32));
 
-  /* RX bit length is 32 bits for each 4 bytes requested
-   * plus 32 bits for status
-   */
+  /* RX bit length is 32 bits for each 4 bytes requested. */
 
   bit_length = 32 * ((length + 3) / 4);
 
-  /* For F1 reads and 32 bits for delay */
+  /* For F1 reads add 32 bits for delay */
 
   if (function == gspi_f1_backplane) bit_length += 32;

Review Comment:
   Minor
   ```suggestion
     if (function == gspi_f1_backplane)
       {
         bit_length += 32;
       }
   ```



-- 
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] pkarashchenko commented on a diff in pull request #7021: Fix race condition in RaspberryPi Pico W WiFi

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


##########
arch/arm/src/rp2040/rp2040_cyw43439.c:
##########
@@ -606,30 +632,35 @@ static int my_read(FAR struct gspi_dev_s  *gspi,
                      rp_io->pio_sm,
                      pio_encode_jmp(rp_io->pio_location));
 
-  /* Set the PIO X (tx bit len) and Y (rx bit len) registers.
+  /* Set the PIO X and Y registers.
+   *
+   * We load X (the TX bit length) with one less than the number of
+   * bits to transmit to the chip. Since we only send the 32-bit command
+   * word we set X to 31.
+   *
+   * We load Y with the number of bits to read.  This is based on the
+   * byte count in "length" which we round up to a 32-bit boundry so the
+   * pio program will be sure to autopush the final data to the output fifo.
+   *
    * This is slightly magical.  The way we load the X is to first
    * push the the number of bits to transmit onto the transmit fifo.
    * Then we force the PIO state machine to execute the instruction
    * "out x, 32" which transfers the word from the output shift
    * register (OSR) to the X register.  When this instruction executes
-   * the PIO will notice the the OSR is empty, so will automatically
+   * the PIO will notice that the OSR is empty, so will automatically
    * pull a value (the one we just added) from the input fifo.
    *
-   * Loading the Y works the same way, except we round the number of
-   * bits up to a multiple of 32, so the pio program will be sure to
-   * autopush the final data to the output fifo.
+   * Loading the Y works the same way.
    */
 
   rp2040_pio_sm_put(rp_io->pio, rp_io->pio_sm, 31);
   rp2040_pio_sm_exec(rp_io->pio, rp_io->pio_sm, pio_encode_out(pio_x, 32));
 
-  /* RX bit length is 32 bits for each 4 bytes requested
-   * plus 32 bits for status
-   */
+  /* RX bit length is 32 bits for each 4 bytes requested. */
 
   bit_length = 32 * ((length + 3) / 4);
 
-  /* For F1 reads and 32 bits for delay */
+  /* For F1 reads add 32 bits for delay */
 
   if (function == gspi_f1_backplane) bit_length += 32;

Review Comment:
   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.

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 merged pull request #7021: Fix race condition in RaspberryPi Pico W WiFi

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


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