espressif / esp-matter

Espressif's SDK for Matter
Apache License 2.0
694 stars 157 forks source link

Using Matter light example to control onboard addressable LED for esp32c6 (CON-1054) #846

Closed julesrodrigues11 closed 8 months ago

julesrodrigues11 commented 8 months ago

I was working with the light example available on the esp-matter repository on the esp32c6 board. I have been trying to make it such that the power button would toggle the addressable LED on board the esp32c6. To this extent, I studied the blink example that is available in the esp-idf repository, and was working on merging the code together. However, I wasn't quite achieving the result I wanted. How would I go about doing this? Many thanks for your time in advance.

espzav commented 8 months ago

Hi @julesrodrigues11, I am so sorry, we found the issue in light example in esp-matter when you use esp32c6. There is bad pin for BOOT selected, it should be GPIO9: CONFIG_BSP_BUTTON_1_GPIO=9.

And should be changed this (all occurrences in the file): image

julesrodrigues11 commented 8 months ago

Hi @espzav , many thanks for your reply. I'm going to implement the changes shortly and test it out. I assume the value of CONFIG_BSP_LEDS_NUM=1 would be correct in this case then. Is that correct? Or what should it be instead?

espzav commented 8 months ago

Yes, this is right settings:

# ESP32-C6-DevKitM-1 Settings
# Buttons
CONFIG_BSP_BUTTONS_NUM=1
CONFIG_BSP_BUTTON_1_TYPE_GPIO=y
CONFIG_BSP_BUTTON_1_GPIO=9
CONFIG_BSP_BUTTON_1_LEVEL=0
# LEDs
CONFIG_BSP_LEDS_NUM=1
CONFIG_BSP_LED_TYPE_RGB=y
CONFIG_BSP_LED_RGB_GPIO=8
CONFIG_BSP_LED_RGB_BACKEND_RMT=y
julesrodrigues11 commented 8 months ago

I've managed to get the light working now. Not exactly how I wanted it, but I'll tinker around with it a bit more and I think I should get it working soon. Many thanks! On another note, is there any documentation with regards to the config settings that can be studied to understand what is correct and what is not.

dhrishi commented 8 months ago

The fix is merged to Github with https://github.com/espressif/esp-matter/commit/bed4aa92e339f28a6419a9d438d3837b30bd51fa. Closing this issue. @espzav Can you please check the above question around the documentation. Thanks!

espzav commented 7 months ago

@julesrodrigues11 Here is documentation for Generic BSP, which is used there: https://github.com/espressif/esp-bsp/tree/master/bsp/esp_bsp_generic