EUA / ESP32_LogicAnalyzer

ESP32 Logic Analyzer
GNU General Public License v3.0
206 stars 27 forks source link

DRAM not fit problem #5

Open ABBAGABBA opened 11 months ago

ABBAGABBA commented 11 months ago

Hello everyone! I've a problem uploading sketch to esp32. If i changing rle_size to 92000 it work, but i dont sure that its right because when i try to run Pulsewviev sniff i have garbage Снимок Снимок1 Снимок2

CW-B-W commented 11 months ago

I've encountered the same problem, and I commented out the time_debug_xxx arrays and it seems to work fine.

Screenshot 2023-07-31 at 7 06 16 AM
ABBAGABBA commented 11 months ago

If i coment out this lines it appear new errors of coplilation

CW-B-W commented 11 months ago

You may try with my update here.

I would suggest you to follow the Quick start guide I wrote.

CW-B-W commented 11 months ago

I tried to set rle_size to 92000, but it still works fine.

ABBAGABBA commented 11 months ago

I'ts great, flashing had no problem, but in pulseview i've no any data from analyzer. How i can chek perfomance? Снимок1

CW-B-W commented 11 months ago

Did you set 10k samples and 50KHz at your first run? I noticed that some options (e.g. 1k samples) seem to be not working, and the ESP32 may get stuck. I use (5k samples, 50KHz) to sample UART with 9600 baud, and it always works fine.

If it works normally, after the sampling is done, on my ESP32 dev board there is an LED turned on for a few seconds (It means ESP32 is sending UART0(i.e. Serial.print()) data). Did your LED ever turned on?

ABBAGABBA commented 11 months ago

Yes, I tryed different variant of samples and frequencys! LED not flashing. I conected to ESP32 LA via arduino serial port on 921600 and I saw that after rebot via rst pin I had no writing symbols, but if I connect on 115200 I had data from esp32 LA on serial monitor, although set in code 921600. And one question about pinuots why you named gpio01 as 18 or i dont understand how it work? 1 2 3 4

CW-B-W commented 11 months ago

Did you follow the exact steps as in Quick start guide? Did you use PlatformIO to build the project? What is your ESP32 platform version in Arduino IDE

When I tried to run this project, I noticed that the latest espressif32 platform seems to not work for this project (Pulseview cannot even scan ESP32), therefore I force it to use espressif32@4.0

BTW, I haven't tried this project with Arduino IDE.


I conected to ESP32 LA via arduino serial port on 921600 and I saw that after rebot via rst pin I had no writing symbols, but if I connect on 115200 I had data from esp32 LA on serial monitor, although set in code 921600.

On the figure which you set baud=115200, I think that's the boot messages from bootloader, not from this project. And I think in default, ESP32 bootloader use baud=115200 to send the boot messages, that's why you see garbled text with baud=921600.

I haven't tried this project with baud=921600 (my ESP32 board cannot support it), does baud=115200 ever work on your ESP32?


And one question about pinuots why you named gpio01 as 18 or i dont understand how it work?

I am not the author of this project, but I think it's because on ESP32 module some GPIO pins are already assigned for other functions in default.

Ref: ESP32-­WROOM-­32 Datasheet -- 6. Schemetics

I think that's why these 3 channels must use other pins.

ozarchie commented 10 months ago

I have tried to make this project work on ESP32DevKit and ESP32S2. It needs major modifications to work on S3 or C3. I have abandoned my efforts but will share some points:

  1. sigrok-cli scans at 115200, so setting this as the baud rate allows PulseView to detect it at connection
  2. the program hangs if dma does not complete: Line 268 :
    while (! s_state->dma_done )
       delay(100);
  3. ledcSetup() needs attention. There is no error checking, and if it fails, then there is no CLK and the capture will not complete. ledcSetup() returns 0, or the freq achieved. If it is zero, then the bitsize and duty need to be adjusted until a valid frequency is returned. https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/ledc.html
    ledcSetup(0, freq_in_hz, 1);
    ledcAttachPin(cfg.gpio_clk, 0);    
    ledcWrite( 0, 1); 

.. something like:

   int freq; int resn = 1; int duty = 1; int i = 0;
do {
    ledcSetup(0, freq_in_hz,resn++;
    ledcAttachPin(cfg.gpio_clk, 0);
    ledcWrite( 0, (duty << i++));
} while ((freq == 0) && (i<7));
EUA commented 10 months ago

Thanks @ozarchie . Indeed problem is; after years Espressif IDF looks like does not accept/support ledc output pin as i2s clk input pin, directly. You need to define another pin and need physically connect those 2 pins. Afterwards, program will be work.

I have released another version. Fixed many things. But no not make any test with C3 or S2 - S3... AFAIK, S3 doesn't have I2S camera input support. So might be not possible to support it. I do not have S2 or S3 but have C3 chip. Will try to support it.

EUA commented 10 months ago

I look at C3 and... I don't say that it's not possible but... Not compatible with current code. Also there are some issues with C3's I2S DMA RX operation, located at here: https://github.com/espressif/arduino-esp32/issues/7648 . I think it's not worth to work for support it. I can implement if you show sample about how to fetch data from I2S RX using DMA...

Also dram not fit problem is fixed by located bug at code... Not appears at v0.31

ozarchie commented 10 months ago

Hi, Thanks for your comments. Indeed, the S3 will not work. At present, I can compile for the S2 but it throws an error for the "loopnez %1, rle_loop_end \n" // Prepare zero-overhead loopassembler line. I am continuing working on the ESP32Devkit and have most things working. thanks for the info about the LDC output - it explains why the dma does not complete. I have changed a lot for my fork to help me understand the SUMP protocol, and to allow different pin configurations for ESP32 and ESP32s2.