eren-terzioglu opened a new pull request, #16995:
URL: https://github.com/apache/nuttx/pull/16995

   ## Summary
   
   <!-- This field should contain a summary of the changes. It will be 
pre-filled with the commit's message and descriptions. Adjust it accordingly -->
   
   * Docs/risc-v/esp32c6: Add lpcore docs
   
   Add lpcore board docs for esp32c6
   
   * tools/espressif: Add lpcore support
   
   Add lpcore support for esp32c6
   
   * boards/risc-v/esp32c6: Add lpcore support
   
   Add lpcore board support for esp32c6
   
   * arch/risc-v/esp32c6: Add lpcore support
   
   Add lpcore support for esp32c6
   
   ## Impact
   <!-- Please fill the following sections with YES/NO and provide a brief 
explanation -->
   
   Impact on user: Yes, they can use LP Core in esp32c6
   <!-- Does it impact user's applications? How? -->
   
   Impact on build: No, build system will be the same
   <!-- Does it impact on building NuttX? How? (please describe the required 
changes on the build system) -->
   
   Impact on hardware: No
   <!-- Does it impact a specific hardware supported by NuttX? -->
   
   Impact on documentation: Yes, ulp defconfig docs  added
   <!-- Does it impact the existing documentation? Please provide additional 
documentation to reflect that -->
   
   Impact on security: No
   <!-- Does it impact NuttX's security? -->
   
   Impact on compatibility: No
   <!-- Does it impact compatibility between previous and current versions? Is 
this a breaking change? -->
   
   ## Testing
   <!-- Please provide all the testing procedure. Consider that upstream 
reviewers should be able to reproduce the same testing performed internally -->
   
   ### Building
   
   ULP processor can be used with 2 ways:
   - Using Pre-Built binary
   - Using NuttX ULP build system for Espressif
   
   #### Using Pre-Built binary
   
   These commands can be used for pre-built binary example
   
   ```
   make -j distclean && ./tools/configure.sh esp32c6-devkitc:ulp && make -j && 
make download ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BAUD=921600 
ESPTOOL_BINDIR=../esp-bin
   ```
   Feature included a pre-built binary which is a blink example. After these 
commands it will include `.bin` file under `boards/risc-v/esp32c6/common/etc/` 
and GPIO0 will blink
   after flashing.
   
   To use pre-built binary with a custom firmware, firstly you need a binary 
that built for ULP core of Espressif devices. You can use ESP-IDF examples and 
toolchain for it. After compilation process copy `.bin` file into NuttX project 
and set the `CONFIG_ESPRESSIF_ULP_PROJECT_PATH` option with given bin file path 
according to nuttx root path. After these steps you can follow same process to 
compile and flash nuttx to Espressif devices.
   
   #### Using NuttX ULP build system for Espressif
   
   <!-- Provide how to build the test for each SoC being tested -->
   
   Before building it a file created called `ulp_blink.c` into 
`nuttx/boards/risc-v/esp32c6/common/etc` and file content looks like this:
   
   ```
   // nuttx/boards/risc-v/esp32c6/common/etc/ulp_blink.c
   
   #include <stdint.h>
   #include <stdbool.h>
   #include "ulp_lp_core_gpio.h"
   
   #define GPIO_PIN 0
   #define nop()   __asm__ __volatile__ ("nop")
   
   bool gpio_level_previous = true;
   
   int main(void)
   {
       while (1)
           {
               ulp_lp_core_gpio_set_level(GPIO_PIN, gpio_level_previous);
   
               /* Delay */
   
               for (int i = 0; i < 10000; i++)
                   {
                       nop();
                   }
           }
   
       return 0;
   }
   ```
   
   ULP code inspired from [ESP-IDF ulp gpio 
example](https://github.com/espressif/esp-idf/tree/master/examples/system/ulp/lp_core/gpio).
   
   After all these changes `esp32c6-devkitc:ulp` config used to test it. Here 
is the command:
   
   ```
   make -j distclean && ./tools/configure.sh esp32c6-devkitc:ulp && 
kconfig-tweak --set-str CONFIG_ESPRESSIF_ULP_PROJECT_PATH 
"boards/risc-v/esp32c6/common/etc" && make olddefconfig && make -j && make 
download ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BAUD=921600 ESPTOOL_BINDIR=../esp-bin
   ```
   
   ### Running
   <!-- Provide how to run the test for each SoC being tested -->
   
   ULP core starts to run itself automatically
   
   ### Results
   <!-- Provide tests' results and runtime logs -->
   
   GPIO0 should start blinking.


-- 
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: [email protected]

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

Reply via email to