-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 port tx/rx for sbus2 #21
Comments
Dear magnum, sorry for the late reply, i was out of office for 2 weeks. please look in "SBUS_usart_ESP32.cpp" the is a define for the Pins. You can use almost every pin you want. actual it's pin 25 and 26 you will need a 1k resistor between rx and tx. Connect the SBUS2 Cable to RX. Keep in mind that this version is not very stable and could have a lot of bugs. That's the reason why i didn't write a "how to" keep me up to Date |
Hi thanks a lot, I found the information by parsing your code, i use a 2.4K resistor and it works. Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1) Backtrace: 0x40081089:0x3ffbe7b0 0x40085165:0x3ffbe7d0 0x40081065:0x3ffbc570 0x400d7853:0x3ffbc590 0x4008b26a:0x3ffbc5b0 0x40089ac9:0x3ffbc5d0 Core 0 register dump: Backtrace: 0x400f096e:0x3ffbbff0 0x400d7853:0x3ffbc010 0x4008b26a:0x3ffbc030 0x40089ac9:0x3ffbc050 Rebooting... rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) I try to find a solution Thanks a lot for your work |
Hi, I think i found the origin of my problem. I change the TX/RX port for the following But in your code you use pin 16 for " trigger PIN for logic analyser " this pin is use in
Can i use an other free port for the trigger Pin ? Thanks |
You can use another port or delete the code with Pin16 It's just for debugging. With that i can connect an oscilloscope or logic analyzer to show me the correct timings. Maybe there is a Problem with TinyGPS or the Softserial |
Hi, I do some more test, I have the problem with TinyGPS++ also in software or hardware serial 2. According to the debugger the ESP32 crash here : Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1) Backtrace: 0x40085119:0x3ffbe7d0 0x40081059:0x3ffbc570 0x400d75bf:0x3ffbc590 0x4008b256:0x3ffbc5b0 0x40089ab5:0x3ffbc5d0 PC: 0x40085119 Decoding stack results it's always the same error, maybe the delay is in cause ? Thanks Julien |
Hello Julien, please delete the delayMicroseconds(5) from the code and check if it's working Sbus telemetry should work without delay |
Hi, I do some more test and i also have crash if i use the adafruit BME280 library. It can work for 5 minutes and after crash every 20s and working again for 5min According to the debugger it's crashing here I'll continue my test Thanks Julien |
Dear Julien, ISR_transmit_frame(void*) is an function called by the Timer Interrupt. But this is just an idea. is the sbus telemetry working without other hardware/libraries? |
Hi, Every things is working fine separately, i'll try to debug by searching timer interrupt Thanks a lot |
Hi, More test today, still crash when SBUS2 function call to send telemetry data
I remark some difference between ESP32 lib et 328P ESP 32 328p arduino noInterrupts(); Are these difference normal ? Thanks |
yes this is normal a big problem with this code is the USART Receive interrupt: But in some cases the interrupt was called permanent But you can only check it with oscilloscpoe or logic analyser. Possible fixes:
Example: |
or try to use a different Timer and/or different USART |
Hi, Thanks for your answer, i played with these value but it still crashing For the interrupt functions critical, i read article and i found an exemple in Jeti Exbus telemetry
For being sure, if i try to do the same thing in SBUS2 ESP32, do i have to do it in these function Sorry for all my question, i'm not a software developper Thanks a lot |
portENTER_CRITICAL_ISR should be in every ISR i think. But it seems that the timer ISR is the Problem. You should start there. I'am also no Software Dev. And ESP32 with RTOS and DUAL is a kind of black magic for me. Greetings John |
Hi, I don't manage to improve the stability, it's crashing all the time when i change parameter. Do you use the SBUS2 Librabry with sensor like bme280 or GPS ? Thanks |
No Could you send me your Project (INO file)? |
i had a look on TinyGPS++ could you try to read GPS data with your Hardware Serial (another than the SBUS Hardwareserial!) and just insert some delay() this test could be easily repeated without GPS sensor, just with a stream of UART Data |
Hi John, Thanks for your help Here the files Julien |
I'll try these this night thanks a lot |
Hi Jonh, I made more test today, i unloaded all library (Tiny GPS, BME280,..) and i still having crash by reading GPS value with only serial.read() command on hardware serial.
Thanks |
That's "good". With a simple Serial Terminal i can send a stread of Data to simulate the Problem could you send me your INO file? |
so a little test today: GPS Data (750 Byte) with 0.1s delay send with HTerm no crash over 30min here my loop: void loop()
} // End of Loop() |
try to update your SBUS lib with this file |
Hi John,
Thanks a lot for your help
I updated with your new library but it's still crashing
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1446 (xQueueGenericReceive)- assert failed!abort() was called at PC 0x4008975b on core 1
Backtrace: 0x4008d284:0x3ffbe6c0 0x4008d4b1:0x3ffbe6e0 0x4008975b:0x3ffbe700 0x400edc90:0x3ffbe740 0x400d19f1:0x3ffbe780 0x40081024:0x3ffbe7a0 0x400850d1:0x3ffbe7d0 0x4000bfed:0x3ffc3a30 0x4008ab65:0x3ffc3a40 0x4008a034:0x3ffc3a60 0x400d375c:0x3ffc3a90 0x400d3b65:0x3ffc3ac0 0x400d2e85:0x3ffc3ae0 0x400d2f3a:0x3ffc3b10 0x400d2f89:0x3ffc3b40 0x400d26b0:0x3ffc3b60 0x400d2920:0x3ffc3b90 0x400d15b2:0x3ffc3bb0 0x400d13bd:0x3ffc3c00 0x400d49b9:0x3ffc3db0 0x40089a35:0x3ffc3dd0
I have notice you add these section, i'll try to change some parameter
uart_intr_config_t uart_intr; uart_intr.intr_enable_mask = UART_RXFIFO_FULL_INT_ENA_M | UART_RXFIFO_TOUT_INT_ENA_M/* | UART_FRM_ERR_INT_ENA_M | UART_RXFIFO_OVF_INT_ENA_M | UART_BRK_DET_INT_ENA_M | UART_PARITY_ERR_INT_ENA_M*/; uart_intr.rxfifo_full_thresh = 25; //UART_FULL_THRESH_DEFAULT, //120 default!! aghh! need receive 120 chars before we see them uart_intr.rx_timeout_thresh = 10; //UART_TOUT_THRESH_DEFAULT, //10 works well for my short messages I need send/receive uart_intr.txfifo_empty_intr_thresh = 10; //UART_EMPTY_THRESH_DEFAULT uart_intr_config(UART_NUM_1, &uart_intr);
ThanksJulien
Le mercredi 15 juillet 2020 à 17:13:51 UTC+2, BrushlessPower <notifications@github.com> a écrit :
try to update your SBUS lib with this file
SBUS_usart_ESP32.zip
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Dear Julien, you should not try to change these Parameters without oscilloscope or logic analyzer! I tested the GPS Stream but i had no crashes. Everything worked perfect. But the USART Interrupt Bug started. But at this point i cant help you any more. I cant reproduce your fault. And i cant use your sketch because i don't have your library's. So start to reproduce the error with my example. And please keep me up to date with your findings. |
Hi John,Thanks a lot, I'll use your test code to try to reproduce the error . Sometimes it's working few minutes before crashing. Julien Le 16 juil. 2020 07:47, BrushlessPower <notifications@github.com> a écrit :
Dear Julien,
you should not try to change these Parameters without oscilloscope or logic analyzer!
The old code had a bug that sometime the USART Interrupt was called all the time without break. I thought it could be the reason for your crashes.
I tested the GPS Stream but i had no crashes. Everything worked perfect. But the USART Interrupt Bug started.
So i fixed that.
But at this point i cant help you any more. I cant reproduce your fault. And i cant use your sketch because i don't have your library's.
So start to reproduce the error with my example. And please keep me up to date with your findings.
Greetings John
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi,
Thank you for your work, i tried to use your sbus2 telemetry on ESP32
Can you tell me on which port i have to connect the SBUS2 signal, tx0/rx0 ? other ?
Do i need a resistance between tx/rx ?
Thanks
Julien
The text was updated successfully, but these errors were encountered: