OpenRTX icon indicating copy to clipboard operation
OpenRTX copied to clipboard

T-TWR Plus fails to complete the boot sequence when SA868 uses NiceRF firmware

Open lyusupov opened this issue 1 year ago • 5 comments

Device: LilyGO T-TWR Plus V2.0 VHF Bootloader: TinyUF2 Firmware: 10/19/2023 nightly build

This is the boot log:

*** Booting Zephyr OS build zephyr-v3.4.0-3837-ga4de2eb3d175 ***
->  getSysPowerDownVoltage:2600
DCDC=======================================================================
DC1  : +   Voltage:3300 mV
DC2  : -   Voltage:900 mV
DC3  : -   Voltage:3400 mV
DC4  : -   Voltage:1100 mV
DC5  : +   Voltage:3300 mV
ALDO=======================================================================
ALDO1: +   Voltage:3300 mV
ALDO2: +   Voltage:3300 mV
ALDO3: +   Voltage:3300 mV
ALDO4: -   Voltage:3300 mV
BLDO=======================================================================
BLDO1: +   Voltage:3300 mV
BLDO2: +   Voltage:3300 mV
===========================================================================
PowerKeyPressOffTime:10 Second
PowerKeyPressOnTime:128 Ms
===========================================================================
Val = 22
Setting Charge Target Current : 797
Setting Charge Target Voltage : 4000
SA8x8: baseband is not ready!
SA8x8: baseband is not ready!

The sequence does not proceed beyond this point.

It would be nice if the boot could proceed all the way down to full featured OpenRTX OLED UI. Then the UI can indicate that RF module is missing or has wrong firmware version.

lyusupov avatar Oct 19 '23 15:10 lyusupov

Hi! We currently do not support the original SA868 firmware, this is why it fails to detect it. In the future we'll show an error message on the screen to inform the user about this.

silseva avatar Oct 20 '23 03:10 silseva

@silseva

We currently do not support the original SA868 firmware

It's Ok. I mean that wrong or missing RF module should not block the boot sequence, right ?

Looks like we will stay in the loop all the time when there is no 'OK' response or baud rate of the poll is different from the baud rate of a module. https://github.com/OpenRTX/OpenRTX/blob/master/platform/drivers/baseband/SA8x8.c#L98-L112

static inline void waitUntilReady()
{
    char buf[SA8X8_MSG_SIZE] = { 0 };

    while(true)
    {
        uartPrint("AT\r\n");
        int ret = k_msgq_get(&uart_msgq, buf, K_MSEC(250));
        if(ret != 0)
            printk("SA8x8: baseband is not ready!\n");

        if(strncmp(buf, "OK\r", SA8X8_MSG_SIZE) == 0)
            break;
    }
}

Shouldn't it be a timed loop instead ?

lyusupov avatar Oct 20 '23 06:10 lyusupov

Sure, it has to be changed to a timed loop. I did it yesterday but then the radio seems to hang somewhere else, I have to investigate more.

silseva avatar Oct 20 '23 15:10 silseva

@lyusupov The version you have also supports SA868 firmware written to openRTX, but it cannot be restored to the original firmware.

lewisxhe avatar Nov 14 '23 10:11 lewisxhe

@lewisxhe Sure! But I am not ready to erase genuine SA868 firmware right now. For the purpose of SoftRF project compatibility - I still need it until OpenRTX one will support the same functions that genuine firmware has.

lyusupov avatar Nov 14 '23 10:11 lyusupov