Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mike Dunston
@atanisoft
I'd likely not worry too much about presence and just attempt to read a block of data and pass it through a noise filter to see if it is interesting or not. The noise filter could be as simple as checking the samples to see if they are all zero or a mix of non-zero/zero).
there are likely a few examples of such code on GitHub
sanketa-54
@sanketa-54
I'm doing same .. checking the samples but getting 0 continously.
Mike Dunston
@atanisoft
and do you have the device connected?
sanketa-54
@sanketa-54
Yes.. with and without getting sample = 0
The code I pasted above is the simple code I'm using for it.
Mike Dunston
@atanisoft
then I'm not sure
sanketa-54
@sanketa-54
Ok.. Let me know if you got something.
sanketa-54
@sanketa-54
WHere Can in get driver/i2s.h header file?
Unable to find
lbernstone
@lbernstone
Does your OS not have any search function?
sanketa-54
@sanketa-54
Unable to find this library on github for arduino
chegewara
@chegewara
#include "cdchost.h"
#define DEVICE_ADDRESS 2
USBHostCDC port(DEVICE_ADDRESS);

void cdc_datain_cb(usb_host_even_t event, void *data)
{
  usb_irp_t *irp = (usb_irp_t *)data;
  Serial.printf("IN EVENT: 0x%x, buffer_len: %d, received: %d\n", event, irp->num_bytes, irp->actual_num_bytes);
  Serial.print("DATA: ");
  for (size_t i = 0; i < irp->actual_num_bytes; i++)
  {
    Serial.printf("%c", irp->data_buffer[i]);
  }
  Serial.println();
}

void cdc_dataout_cb(usb_host_even_t event, void *data)
{
  usb_irp_t *irp = (usb_irp_t *)data;
  Serial.printf("OUT EVENT: 0x%x, buffer_len: %d, sent: %d\n", event, irp->num_bytes, irp->actual_num_bytes);
  Serial.print("DATA: ");
  for (size_t i = 0; i < irp->actual_num_bytes; i++)
  {
    Serial.printf("%c", irp->data_buffer[i]);
  }
  Serial.println();
}

void setup()
{
  Serial.begin(115200);
  port.init();
  port.onDataIn(cdc_datain_cb);
  port.onDataOut(cdc_dataout_cb);
}

void loop()
{
  delay(10);
  while (Serial.available())
  {
    size_t l = Serial.available();
    uint8_t b[l];
    l = Serial.read(b, l);
    port.sendData(b, l);
  }
}
how this code looks like? is it functional and easy to use?
Mike Dunston
@atanisoft
@chegewara overall looks ok, not sure what the difference between the two CDC callbacks are though. You might consider passing the type usb_irp_t * instead of void * to avoid confusion on the user side as to the wrapping of the data
chegewara
@chegewara
difference is that 1 callback is for IN endpoint and 1 for OUT endpoint
usually you dont need OUT callback, because it is like echoing
funny thing is this code shows me some issue on C3 i have
Mike Dunston
@atanisoft
interesting, so the OUT cb is just to provide the user code with data that is being send out to the CDC?
chegewara
@chegewara
and status from irp
initial commit is on github and works with arduino master branch
lbernstone
@lbernstone
C3 rev3 programs over CDC properly?
Mike Dunston
@atanisoft
Likely.
chegewara
@chegewara
yes
Rajesh Kumbhakar
@Rajssss

Hello everyone, I am trying to make a Arduino program work with arduino core as a IDF component. I am using the latest master branch of both esp-idf & arduino-esp32.
I got alot of errors related to esp_littlefs & then esp-rainmaker, but fixed those thanks to this : espressif/arduino-esp32#5064
Right now I am getting these errors: https://del.dog/arduino_esp_error.txt

Please help me out :(

Also I am build my project in eclipse 2021-03 with latest eclipse plugin.
chegewara
@chegewara
did you copy/paste sdkconfig from arduino-esp32 to your project?
Rajesh Kumbhakar
@Rajssss

did you copy/paste sdkconfig from arduino-esp32 to your project?

aah, no.

i just ran idf.py menuconfig before build
chegewara
@chegewara
yes, you should run idf.py, but before you do that yu need to copy sdkconfig to have initial arduino values
Rajesh Kumbhakar
@Rajssss

ok

yes, you should run idf.py, but before you do that yu need to copy sdkconfig to have initial arduino values

Ok, I have fixed those errors and copied the sdkconfig file.
But now I am getting this error:
Arduino.h: No file or directory

chegewara
@chegewara
did you clone arduino-esp32 into components folder?
Rajesh Kumbhakar
@Rajssss

did you clone arduino-esp32 into components folder?

yes

chegewara
@chegewara
then you are on your own now, maybe you messed something with sdkconfig
chegewara
@chegewara
reset C3 with DTR/RTS:
rst:0x15 (USB_UART_CHIP_RESET),boot:0xc (SPI_FAST_FLASH_BOOT)
Mike Dunston
@atanisoft
@chegewara triggered from S2?
chegewara
@chegewara
yes
here is full dump after reset:
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x420032c0
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x1664
load:0x403ce000,len:0x8a8
load:0x403d0000,len:0x28fc
entry 0x403ce000
I (24) boot: ESP-IDF v4.4-dev-1594-g1d7068e4b-dirty 2nd stage bootloader
I (24) boot: compile time 19:43:07
I (25) boot: chip revision: 3
I (28) boot.esp32c3: SPI Speed      : 80MHz
I (33) boot.esp32c3: SPI Mode       : DIO
I (38) boot.esp32c3: SPI Flash Size : 2MB
I (42) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (66) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 00100000
I (81) boot: End of partition table
I (85) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=061c0h ( 25024) map
I (98) esp_image: segment 1: paddr=000161e8 vaddr=3fc89400 size=013c4h (  5060) load
I (103) esp_image: segment 2: paddr=000175b4 vaddr=40380000 size=08a64h ( 35428) load
I (117) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=14590h ( 83344) map
I (132) esp_image: segment 4: paddr=000345b8 vaddr=40388a64 size=00818h (  2072) load
I (133) esp_image: segment 5: paddr=00034dd8 vaddr=50000000 size=00010h (    16) load
I (140) boot: Loaded app from partition at offset 0x10000
I (144) boot: Disabling RNG early entropy source...
I (149) cpu_start: Pro cpu up.
I (165) cpu_start: Pro cpu start user code
I (165) cpu_start: cpu freq: 160000000
I (165) cpu_start: Application information:
I (167) cpu_start: Project name:     hello-world
I (173) cpu_start: App version:      v4.4-dev-1594-g1d7068e4b-dirty
I (180) cpu_start: Compile time:     Jun 10 2021 19:43:05
I (186) cpu_start: ELF file SHA256:  ae013b446e7ab839...
I (192) cpu_start: ESP-IDF:          v4.4-dev-1594-g1d7068e4b-dirty
I (199) heap_init: Initializing. RAM available for dynamic allocation:
I (206) heap_init: At 3FC8B620 len 000349E0 (210 KiB): DRAM
I (212) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (219) heap_init: At 50000010 len 00001FF0 (7 KiB): RTCRAM
I (225) spi_flash: detected chip: generic
I (228) spi_flash: flash io: dio
W (229) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
Mike Dunston
@atanisoft
@Rajssss make sure you have the correct dependency added to your CMakeFiles.txt for your cloned/copied arduino-esp32 tree.
chegewara
@chegewara
reset is as simple as that:
// port.setControlLine(DTR, RTS);
port.setControlLine(0, 1);
port.setControlLine(1, 1);
port.setControlLine(1, 0);
port.setControlLine(0, 0);
ive been trying to switch C3 into download mode, but that does not works, instead it just reboot C3
to be honest it looks better than i expected from host app point of view
chegewara
@chegewara
now we can add SD card and it can be small battery powered data logger to file for example for remote logging
Mike Dunston
@atanisoft
Add a helper method like port.bootIntoDownload() and have the small delays between the control line adjustments.
chegewara
@chegewara
:), the same set of command switch esp32 S2 USB device into download mode
Yordan Yanakiev
@YordanYanakiev
Hello.
I am getting "ELF file SHA256: 0000000000000000" while trying to do OTA update
and honestly I got no idea where even to start looking.
I am using Visual Studio + Visual Micro, the board is TTGO T-Watch 2020 v1, ESP32-Arduino v1.06.
Rajesh Kumbhakar
@Rajssss

Hello everyone, I am trying to use a arduino library for max30100, my project uses arduino-core as esp-idf component.
But I am getting these errors:
../components/max30100/MAX30100_BeatDetector.cpp:21:10: fatal error: Arduino.h: No such file or directory

../components/max30100/MAX30100_PulseOximeter.cpp:21:10: fatal error: Arduino.h: No such file or directory

../components/max30100/MAX30100.cpp:21:10: fatal error: Wire.h: No such file or directory

looks like the library couldn't find those headers, yet it does in main.cpp

and yes i have cloned the core inside components folder and built blink example without any issues
Rajesh Kumbhakar
@Rajssss

@Rajssss make sure you have the correct dependency added to your CMakeFiles.txt for your cloned/copied arduino-esp32 tree.

Can you please elaborate? What should be added in CMakeLists.txt?