Comments (7)
please try again with latest develop branch .fixed.
from bluepad32.
very interesting... which controller are you using ?
from bluepad32.
also, please attach the logs from the console... it should never return NULL
... wondering if the memory got corrupted.
and does it get reproduced from the example/pico
project ?
from bluepad32.
Tested on commit with first pico W example, experienced the issue with most recent changes too.
Issue is reproducible in a Joycon L, Joycon R (both firmware 4.25) and a generic Switch Pro Controller (no specified firmware in logs).
For logging I the code is laid out like this:
// Reply to SUBCMD_SPI_FLASH_READ
static void process_reply_spi_flash_read(struct uni_hid_device_s* d, const struct switch_report_21_s* r, int len) {
logi("Entering: process_reply_spi_flash_read\n");
int mem_len = r->data[4];
logi("mem_len: %d\n", mem_len);
uint32_t addr = r->data[0] | r->data[1] << 8 | r->data[2] << 16 | r->data[3] << 24;
logi("addr: 0x%04x\n", addr);
switch_instance_t* ins = NULL;
logi("about to get switch instance\n");
ins = get_switch_instance(d);
if(!ins) {
logi("ins is NULL\n");
return;
}
logi("ins state: %d\n", ins->state);
switch (ins->state) {
case STATE_READ_FACTORY_STICK_CALIBRATION:
process_reply_read_spi_factory_stick_calibration(d, r->data, mem_len + 5);
break;
case STATE_READ_USER_STICK_CALIBRATION:
process_reply_read_spi_user_stick_calibration(d, r->data, mem_len + 5);
break;
case STATE_READ_FACTORY_IMU_CALIBRATION:
process_reply_read_spi_factory_imu_calibration(d, r->data, mem_len + 5);
break;
case STATE_DUMP_FLASH:
process_reply_read_spi_dump(d, r->data, mem_len + 5);
break;
default:
loge("Switch: unexpected spi_read size reply %d at 0x%04x\n", mem_len, addr);
printf_hexdump((const uint8_t*)r, len);
};
logi("Exiting: process_reply_spi_flash_read\n\n");
}
This is the resulting output:
2CAP_EVENT_CHANNEL_OPENED (channel=0x0042)
PSM: 0x0013, local CID=0x0042, remote CID=0x0041, handle=0x000b, incoming=0, local5
HID Interrupt opened, cid 0x42
Device 80:D2:E5:2A:D6:55 is connected
my_platform: device connected: 0x2000396c
uni_bt_process_fsm, bd addr:80:D2:E5:2A:D6:55, state: 12, incoming:0
uni_bt_process_fsm: Device is ready
Switch: IMU report enabled
Switch: Firmware version: 4.25. Controller type=1
Entering: process_reply_spi_flash_read
mem_len: 18
addr: 0x603d
about to get switch instance
ins state: 3
Switch: Stick calibration info: x=587,1827,3231, y=1080,2225,3384, rx=0,4095,8190,0
Exiting: process_reply_spi_flash_read
Entering: process_reply_spi_flash_read
mem_len: 22
addr: 0x8010
about to get switch instance
ins state: 4
Exiting: process_reply_spi_flash_read
Entering: process_reply_spi_flash_read
mem_len: 24
addr: 0x6020
The last logi("about to get switch instance\n");
should be printed, maybe it crashes before it gets flushed to stdio
.
from bluepad32.
Confirmed it's not getting flushed on time due to the pico crashing, adding sleep_ms(10000)
before logi("about to get switch instance\n");
gets the pico up to here:
...
Entering: process_reply_spi_flash_read
mem_len: 22
addr: 0x8010
about to get switch instance
ins state: 4
Exiting: process_reply_spi_flash_read
Entering: process_reply_spi_flash_read
mem_len: 24
addr: 0x6020
about to get switch instance
ins state:
from bluepad32.
I can repro on Pico W.
Cannot repro on Linux.
Cannot repro on ESP32.
weird
from bluepad32.
Looks ok now
from bluepad32.
Related Issues (20)
- ESP32 Pico D4 support HOT 2
- bluepad32 arduino library should be open source HOT 3
- Dualsense PS5 controller bluetooth range? HOT 3
- Add setFlash option for Dualsense RGB LED HOT 2
- Timeout selection need for disconnected controller HOT 2
- PS4 esp32 HOT 3
- Add improved Rumble API: weak / strong magnitude, delayed start, and duration in ms HOT 1
- Arduino Nano ESP32 / Lolin S3 mini: Serial output not working HOT 3
- [Bug]: 8bitdo controllers go into constant rumble with new play_dual_rumble API HOT 25
- [Bug]: Pico SIGTRAP in Switch IMU parsing
- Filter gamepad connection HOT 2
- [Bug]: erro ao baixar pacote de placas HOT 7
- [Bug]: Failed to disconnect HIDS client for hids_cid=0, status=2 HOT 1
- [Bug]: 4.0.2 reports weird 99.99.99 version after flashing HOT 6
- [Bug]: More than three Xboxone handles will cause problems HOT 15
- [Bug]: Xbox One controller hangs on pairing HOT 8
- [Bug]: Warning message when Gamesir T3s connects HOT 1
- ESP32-C3 does not found Switch / 8Bitdo Controller but XBOX Wireless Controller HOT 3
- SDK Config Parameter for Analog->Digital presses HOT 1
- SDK parameter to control button remapping by position or lettering HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluepad32.