Skip to content

Issue flashing firmware to ESP32-S3 #33

@dfgHiatus

Description

@dfgHiatus

Hello, I am attempting to write a merged firmware file using your tool to an ESP32-S3 I own. I have attached the code I am using to accomplish this, it is based off of the sample code:

public class FirmwareService
{
    public event Action OnFirmwareUpdateStart;
    public event Action<float> OnFirmwareUpdateProgress;
    public event Action OnFirmwareUpdateComplete;


    public async Task UploadFirmwareAsync(string port, string pathToFirmware, CancellationToken token = default)
    {
        var toolbox = new ESPToolbox();
        var communicator = toolbox.CreateCommunicator();
        toolbox.OpenSerial(communicator, port,  115200);

        var loader = await toolbox.StartBootloaderAsync(communicator);
        var chipType = await toolbox.DetectChipTypeAsync(loader);

        var softloader = await toolbox.StartSoftloaderAsync(communicator, loader, chipType);
        await toolbox.ChangeBaudAsync(communicator, softloader, 921600);

        var uploadTool = toolbox.CreateUploadFlashDeflatedTool(softloader, chipType);
        var myFirmware = GetFirmware(pathToFirmware);
        var progress = new Progress<float>(p => OnFirmwareUpdateProgress?.Invoke(p));

        OnFirmwareUpdateStart?.Invoke();
        await toolbox.UploadFirmwareAsync(uploadTool, myFirmware, token, progress);
        await toolbox.ResetDeviceAsync(communicator);
        OnFirmwareUpdateComplete?.Invoke();
    }

    private IFirmwareProvider GetFirmware(string pathToFirmware) // this is the local path of the merged-firmware.bin file
    {
        return new FirmwareProvider(
            entryPoint: 0x00000000,
            segments:
            [
                new FirmwareSegmentProvider(0x00000000, File.ReadAllBytes(pathToFirmware)),
            ]
        );
    }
}

Interestingly, while I am able to write to the device, and the device shows up in the device manager, it does not function as intended. I am trying to use this to make the device act as a serial camera for Project Babble. I am able to use the EyeTrackVR Firmware Flashing Tool here to flash the device, if it is any context.

To reproduce:

  1. Create a new console project, and insert the above code/firmware attached in question
  2. Wait for the firmware to flash
  3. Download Project Babble. Attempt to open the serial camera as input, observe nothing happens
  4. Download the ETVR Firmware Flashing app and flash Babble_USB-wrooms-s3-v2.9.1-main to your device
  5. Repeat step 3, observe the device tracker works

After speaking with an ETVR dev, I cam confirm this is how their app works for the merged Babble firmware (device offsets of 0 when flashing)

I have also attached the merged firmware file in question. This is the Babble_USB-wrooms-s3-v2.9.1-main firmware, you can find a copy of it in the releases for OpenIris.

I have also attached a device log. It appears to be bootlooping here?

Let me know if you have any questions! I would be happy to clarify things

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions