darthcloud / BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles
https://blueretro.io
Apache License 2.0
1.23k stars 103 forks source link

Blueretro won't respond with v1.9.2_hw1_universal #952

Closed asweintraub closed 2 months ago

asweintraub commented 2 months ago

BlueRetro firmware version

v1.9.2_hw1_universal

BlueRetro firmware specification

HW1

BlueRetro firmware variant

Universal

BlueRetro hardware type

External adapter with detachable cord

Manufacturer

Generic/aliexpress

System used

Nintendo 64

Bluetooth controller brand & name

N/A

What is problem? (only list ONE problem per report)

I just tried updating my blueretro adapter from 1.9.1 to 1.9.2 (using both bluetooth and USB) and it refuses to boot. After flashing 1.9.2 and resetting it, the blue light blinks once every 10s or so instead of doing the normal pulse when waiting to connect to a controller.

I am able to see see the adapter pop up as a bluetooth device on blueretro.io, but it refuses to connect 100% of the time. Downgrading back to 1.9.1 via USB fixes the issue.

I also tried with the N64-specific firmware, and this seems to work fine. It seems to be an issue only with the universal firmware.

What did you expect to happen?

Adapter works with 1.9.2 universal firmware.

Attach files like logs or Bluetooth traces here

No response

darthcloud commented 2 months ago

Universal v1.9.2 work fine for me on my own adapter.

If possible with your adapter try to get the serial logs: https://github.com/darthcloud/BlueRetro/wiki/Getting-BlueRetro-debug-logs-via-Serial-port-Windows-10

asweintraub commented 2 months ago

Just got a chance to try this out. I get the following on loop every 10 or so seconds. blueretro logs.txt

The main error seems to be:

# opcode: 0x0403 error: 0x0C retry: 0

assert failed: block_trim_free tlsf.c:496 (block_is_free(block) && "block must be free")

Backtrace: 0x400816fe:0x3ffd2500 0x40091a9d:0x3ffd2520 0x4009d8c1:0x3ffd2540 0x400d3f11:0x3ffd2660 0x400d3a2d:0x3ffd2680 0x400d33ea:0x3ffd26a0 0x400d341d:0x3ffd26d0 0x400d3449:0x3ffd26f0 0x4009d8e5:0x3ffd2710 0x400d93bb:0x3ffd2730 0x4009705c:0x3ffd27c0 0x40092711:0x3ffd27f0
darthcloud commented 2 months ago

v1.9.2 now use the NVS partition, I guess somehow that area on your specific device got something into it that make the adapter crash when running with v1.9.2.

Try to reflash v1.9.2 and add the ota.bin 2 additional time at 0x9000 & 0xB000 to reset the NVS partition like so: flash_download_tool_3 9 5_OruhMvDjwz

Full doc: https://github.com/darthcloud/BlueRetro/wiki/Flashing-firmware-Windows-10

asweintraub commented 2 months ago

Thank you! Just tried flashing those partitions as well, and I'm getting the exact same error. Do I just have a bad device, or could it be something else? In case this is relevant, my Blue Retro Core has an ESP-WROOM-32..

ETA: It looks like the ESP-WROOM-32 is the recommended chip in the BlueRetro docs, so it's probably not relevant.

image blueretro logs2.txt

darthcloud commented 2 months ago

Probably not if v1.9.1 work fine, I'll look into the change of v1.9.2 again. I might give you a few different build to test later this week.

v1.9.2 universal work fine for me on my N64 so this quite strange.

darthcloud commented 2 months ago

Try to flash the ota bin at 0x310000 also.

On first power on it won't work right away, give it a good 1 minute to recreate it's partition (status led will be off) when its done the LED will start pulsing as usual.

Power off and power on again let me know if that work.

asweintraub commented 2 months ago

v1.9.2 universal work fine for me on my N64 so this quite strange.

It doesn't actually seem to matter what console I try to use. I've tried booting the BlueRetro with an N64 cable, Wii Ext cable, or no cable at all, and I get the same issue with all of them.

Try to flash the ota bin at 0x310000 also.

I just tried, but the blue status led was on during the entire time it was formatting. Once it was finished, it was back to the same error message as before.

Thanks again for all of your help with this!

blueretro logs 3.txt

darthcloud commented 2 months ago

I think the issue come from PS2 pressure buttons feature that is using a significant amount of HEAP memory.

I see the memory card malloc fail in v1.9.2 in mine now, look to be at same step yours crash. No sure why your crash.

Anyway in the latest beta I do not see the malloc fail (probably less memory usage due to the updated esp-idf)

Can you try the latest build?: https://github.com/darthcloud/BlueRetro/actions/runs/8680779369

asweintraub commented 2 months ago

That worked!

Thank you so much for all of the help, and let me know if you need me to run any more tests on this.

darthcloud commented 2 months ago

Fixed in v24.04