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/06/27 03:18:53 UTC

[GitHub] [incubator-nuttx] curuvar opened a new pull request, #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   ## Summary
   
   Added Board definition files for Adafruit KB2040 and Adafruit Feather RP2040.
   
   Added NeoPixel driver that supports the upper-half/lower-half model for RP2040.
   This was necessary as the existing ws2812 driver only outputs to SPI pins and those don't map to the neopixels on the new boards. The implementation uses the PIO hardware.  I'm planning to update the RP2040 neopixel driver to use DMA so other code can run while the pixels are being update.
   
   ## Impact
   
   Should not impact existing code.
   
   ## Testing
   
   Created builds with new code and tested driver with single and multiple neopixel chains.
   
   


-- 
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] curuvar commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   I agree that it would be better to use the more generic name.   I didn't try to work with the existing ws2812 as it is so closely wedded to SPI and I cannot use SPI to drive the on-board pixels on the Adafruit RP2040 boards.
   
   Also, I choose a slightly different model for mine.  Instead of the driver buffering the pixel data I just let the user write whatever string of pixels needed.  That seemed more straightforward, but I can see the utility in having a the driver maintain a single buffer that different apps could update.
   
   Anyone care to suggest a new name for mine (ws2812b ?) so the two can exist in parallel so as not to break existing code.
   
   


-- 
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] diegoherranz commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   After reading the code again, I think it was an attempt to express always the bit frequency directly. But, for SPI, it wouldn't be divided by 10 either, but by 8. Given that only a few SPI frequencies can be obtained in many MCUs, I find it clearer to define the actual SPI frequency when in SPI mode.
   
   I've submitted https://github.com/apache/incubator-nuttx/pull/6849 to revert that behaviour for the SPI mode and explained it in detail in Kconfig.
   
   I hope that's OK. Thanks!


-- 
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] btashton merged pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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


-- 
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 commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   @curuvar currently there is only a board using @btashton original WS2812 driver, so I think you can modify his driver to include your improvement. Also because there are many RBG matrixes powered by WS2812 on Aliexpress and others sites it could be interested to create a driver to use WS2812 matrix like an ordinary LCD display, like I the MAX7219 driver drivers/lcd/max7219.c see the video here: https://www.youtube.com/watch?v=Xpr1VTV5iKw&t=250s


-- 
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] btashton commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   Seems like we should combine the two drivers, even if that means making some changes to the existing one. neopixel is just a marketing name for the same chip. 
   
   I wrote the original one and would be happy to see the upperhalf change to support other lower half drivers. I did something similar in a private branch to use the SAMD timers (the spi controller on that chip won't drive them).


-- 
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] btashton commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   Yeah there is at least one other person that modified it a bit to support a non in-tree board but I fully support making changes to improve this even if it does mean changing the interface slightly. I think that is better than having two implementations to support. 


-- 
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] diegoherranz commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   Why has CONFIG_WS2812_FREQUENCY been scaled by 10?
   
   https://github.com/apache/incubator-nuttx/blame/master/drivers/leds/ws2812.c#L81 and similar changes.
   
   It breaks existing out-of-tree board configs. And I'm not even sure why we would want to have scaled down.
   Is it a mistake? Are we OK to revert that bit?
   
   Thanks!


-- 
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] curuvar commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   After thinking about this, I am going to change my driver so it works the same (from the users point of view) as ws2812 and combine the two into the same file.  That way, any existing lower-halfs will continue to work with the existing ws2812 upper-half while new ones that don't implement SPI can also be used.
   
   This implementation detail will be hidden from any code that uses the driver allowing existing lower-halfs to be migrated to the new model if desired.


-- 
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 commented on a diff in pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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


##########
boards/arm/rp2040/adafruit-feather/README.txt:
##########
@@ -0,0 +1,180 @@
+README
+======
+
+This directory contains the port of NuttX to the Adafruit Feather RP2040.
+See https://www.adafruit.com/product/4884 for information
+about Adafruit Feather RP2040.
+
+Currently only the following devices are supported.
+
+  Supported:
+  - UART  (console port)
+    - GPIO 0 (UART0 TX) and GPIO 1 (UART0 RX) are used for the console.
+  - I2C
+  - SPI
+  - DMAC
+  - PWM
+  - USB device
+    - MSC, CDC/ACM serial and these composite device are supported.
+    - CDC/ACM serial device can be used for the console.
+  - PIO (RP2040 Programmable I/O)
+  - Flash ROM Boot
+  - SRAM Boot
+    - If Pico SDK is available, nuttx.uf2 file which can be used in
+      BOOTSEL mode will be created.
+  - BMP180 sensor at I2C0 (don't forget to define I2C0 GPIOs at "I2C0 GPIO pin assign" in Board Selection menu)
+  - INA219 sensor / module (don't forget to define I2C0 GPIOs at "I2C0 GPIO pin assign" in Board Selection menu)
+  - Pico Display Pack (ST7789 LCD)
+    - RGB leds and buttons are not supported yet.
+  - Pico Audio Pack (PCM5100A I2S DAC)
+    - I2S interface is realized by PIO.
+
+  Not supported:
+  - All other devices
+
+Installation
+============
+
+1. Download Raspberry Pi Pico SDK
+

Review Comment:
   Please consider adding README.txt to nuttx/Documentation/ that will be available online, i.e.: https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32s3/boards/esp32s3-eye/index.html



##########
boards/arm/rp2040/adafruit-kb2040/src/rp2040_appinit.c:
##########
@@ -0,0 +1,78 @@
+/****************************************************************************
+ * boards/arm/rp2040/adafruit-kb2040/src/rp2040_appinit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/board.h>
+
+#include "rp2040_pico.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef OK
+#  define OK 0
+#endif

Review Comment:
   ditto



##########
boards/arm/rp2040/adafruit-feather/src/rp2040_appinit.c:
##########
@@ -0,0 +1,78 @@
+/****************************************************************************
+ * boards/arm/rp2040/adafruit-feather/src/rp2040_appinit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/board.h>
+
+#include "rp2040_pico.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef OK
+#  define OK 0
+#endif

Review Comment:
   Please consider "#include <sys/types.h>" instead of doing 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.

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] curuvar commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   Can someone explain to me what the Check/check status means?  stm32_wlan_firmware.c isn't a file I did anything to.


-- 
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 commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   Nice work @curuvar 


-- 
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] curuvar commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   I combined my code for the ws2812 driver with the existing driver.  This is still somewhat of a work in progress.  I want to improve the code that actually outputs the bits to the pixel chain so that it runs in the background instead of hogging the CPU.
   
   
   
   I'm fixing the code check issues (I thought I ran that scan before committing).


-- 
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 commented on pull request #6528: Added RP2040 Boards: Adafruit KB2040 and Adafruit Feather RP2040

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

   @btashton could you please review and remove the Change Request?


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