Git Product home page Git Product logo

Comments (7)

ricardoquesada avatar ricardoquesada commented on May 31, 2024

The more detailed the context, the better.

Which firmware are you using? one modified by you?

This indicates that it is running in a ESP32:

I (27) boot: ESP-IDF v4.3.1 2nd stage bootloader

This indicates that it is running in a PC:

Platform: PC Debug

So, that's weird...

Also, from where are you calling uni_gamepad_dump() ?

from bluepad32.

zeroxxx88 avatar zeroxxx88 commented on May 31, 2024

I set the platform to PC_ Debug,and change some GPIO pin maping, to test xboxone controller.

using the original uni_platform_pc_debug. c file.So far,it work fine if I comment out uni_gamepad_dump funtion.

maybe UART TX cause the problem?

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

I wouldn't know... testing the pc_debug platform in ESP32 is not tested...
Look at the ISR code... seems that you might be calling uni_dump_gamepad from there... and that most probably trigger the watchdog...

closing bug since this is not a Bluepad32 bug.

For future reference, post the entire code... will help me understand better the context

from bluepad32.

zeroxxx88 avatar zeroxxx88 commented on May 31, 2024

For example, print log in function "pcdebug_on_gamepad_data"

I found that the problem was caused by print log.If log length exceeds 92 characters, it will certainly appear.

This is my first time using esp32,I am learning,and can't find the reason.If my usage is wrong, please correct it, thank you!
.............................................
............................................
static void pc_debug_on_gamepad_data(uni_hid_device_t* d, uni_gamepad_t* gp) {
UNUSED(d);
static uni_gamepad_t prev = {0};
if (memcmp(&prev, gp, sizeof(*gp)) == 0) {
return;
}
prev = *gp;

	logi("(0x%02x),dpad=0x%02x, x=%d, y=%d, rx=%d, ry=%d, brake=%d, accel=%d, buttons=0x%08x, misc=0x%02x\n",
     gp->updated_states,                                          // state
      gp->dpad, gp->axis_x, gp->axis_y, gp->axis_rx, gp->axis_ry,  // axis
     gp->brake, gp->throttle, gp->buttons, gp->misc_buttons       // misc
);

.............................................
.............................................

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

How familiar are you with microcontrollers?

From your first comment where you pasted the error:

Core 0 was running in ISR context:
EPC1 : 0x400d3aef EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x400877e3
0x400d3aef: uart_hal_write_txfifo at D:/Desktop/esp-idf/components/hal/uart_hal_iram.c:35

It seems that the ESP32 is sending (printing) to the console inside a ISR (Interrupt Service Routine).
What ever you put in a ISR must be super fast.

Printing a few lines to the console might be Ok... but dumping the gamepad state for each packet received is not...

Long story short: don't dump the gamepad data to the console

from bluepad32.

zeroxxx88 avatar zeroxxx88 commented on May 31, 2024

I've only used 51 and arm before,with no os.

Now I understand a little,The freeRTOS.Thanks

By the way, Xbox controllers are sometimes very difficult to connect, whether you restart esp32 or the controller or press the sync butn.But sometimes it's very easy to connect. I tried to find out the reason,but it's too difficuilt to me now.

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

yep... Xbox controllers are kind of flaky... just make sure that you are using Bluepad32 v3.0.0 (or newer)... Xbox connection was improved in that version ... although not as reliable as DualShock or Nintendo's controllers

from bluepad32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.