Always check serial monitor output first. Run
idf.py -p PORT monitor (or idf.py -p PORT flash monitor to flash and monitor in one step) and look for ESP-IDF error codes, assertion failures, and backtraces — they usually point directly at the root cause.Build fails: component not found
Build fails: component not found
The build system cannot locate the
omrawaley/pocketbyte component. This usually means the component has not been downloaded yet, or the idf_component.yml file is missing or malformed.Steps to fix:- Confirm that
main/idf_component.ymlexists and contains a valid dependency declaration:
- Run the dependency resolver explicitly:
- If the error persists, delete the
managed_components/directory and try again:
- Make sure you have an active internet connection the first time you build — the component manager must download the SDK from the IDF Component Registry.
Flash fails: port not found or permission denied
Flash fails: port not found or permission denied
idf.py flash reports that the specified port does not exist or that access is denied.Port not found:- Verify the device is connected via a USB data cable (not a charge-only cable).
- Run the following to list available ports, then match your device:
- Common port names:
/dev/ttyUSB0,/dev/ttyACM0(Linux),/dev/cu.usbserial-*(macOS),COM3(Windows).
dialout group, which owns the serial port device.newgrp dialout) for the group change to take effect. Then retry the flash command.Device not entering flash mode
Device not entering flash mode
The flash command hangs at “Connecting…” and eventually times out, meaning Pocketbyte is not entering the ROM bootloader’s download mode.Manual method:
- Hold the BOOT button on the device.
- While holding BOOT, press and release the RESET button.
- Release the BOOT button.
- Run
idf.py -p PORT flashimmediately.
- Hold the BOOT button.
- Plug the USB cable in while holding BOOT.
- Release the BOOT button.
- Run
idf.py -p PORT flash.
Display stays blank after flashing
Display stays blank after flashing
The firmware flashes successfully and the device boots, but the screen remains blank.Most common causes and fixes:
pocketbyte_init()not called — this function must be the first Pocketbyte call inapp_main()before any display, audio, or input functions:
pocketbyte_display_flush()not called — drawing functions write to an off-screen buffer. Nothing appears on screen until you flush the buffer:
- Incorrect display rotation in
menuconfig— openidf.py menuconfig, navigate to Component config → Pocketbyte → Display rotation, and verify the rotation matches your hardware orientation.
No audio output
No audio output
The device runs but produces no sound even when your code calls audio playback functions.Checklist:
- Confirm
pocketbyte_audio_init()is called before any audio playback functions:
- Check that the volume is not set to zero. The default volume is configured in
menuconfig(Component config → Pocketbyte → Default audio volume). You can also set it at runtime:
- Verify the speaker or audio output hardware is connected properly if you are working with a custom build.
- Check the serial monitor for errors from the audio driver at boot time.
Input not responding
Input not responding
Button presses or joystick movements have no effect in your app.Most common causes:
pocketbyte_input_update()not called each frame — the input system does not poll hardware automatically. You must call this function at the start of every game loop iteration before reading any button or axis state:
- Input module not fully seated — remove the input module and reinsert it firmly until it clicks into place. A partially connected module may not be detected correctly.
- Wrong module type in
menuconfig— if you set a manual input module override, verify it matches the module you have installed. Switch back to Auto-detect if unsure.
App crashes or resets in a loop
App crashes or resets in a loop
The device boots, runs briefly, then resets repeatedly. The serial monitor shows a crash backtrace or a
Guru Meditation Error.Debugging steps:- Read the backtrace — open the serial monitor (
idf.py -p PORT monitor) and let the device crash. The monitor decodes the backtrace and shows the source file and line number of the crash. - Stack overflow — if the backtrace shows
Task stack overfloworconfigCHECK_FOR_STACK_OVERFLOW, increase the stack size of the offending task. Forapp_main, set a larger stack inmenuconfigunder Component config → ESP System Settings → Main task stack size. - Null pointer dereference — look for any pointers you use before initialising them. Common culprits: forgetting
pocketbyte_init()before using SDK handles, or storing the return value of a function that can returnNULLon failure without checking it. - Watchdog timeout — if your game loop blocks for too long without yielding, the task watchdog resets the device. Add a small
vTaskDelay(pdMS_TO_TICKS(1))at the end of your loop if you are not usingpocketbyte_display_flush()as a natural yield point.
