This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] TDA4VM: Ability to change boot mode in SW

Part Number: TDA4VM

I do not have UART boot mode on my custom board due to lack of switch / pins which can configure the boot mode. Is there a way by which I can change the boot mode in software using gel scripts?

  • As a SW workaround, we can use the below GEL functions to change bootmodes when primary boot mode is not flashed.

    1. Power on the board.

    2. Do not launch any launch script / GEL files just connect to the MCU R5F, this should be able to be connected as the DMSC ROM take the MCU R5F out of reset where the R5 ROM runs.

    3. Load the gel files and from the scripts run the "Change_bootmode_to_UART" script, this would change the MCU_BOOTMODE and the BOOTMODE values and issue a soft reset to the SoC. Upon the reset, ROM code will run and read the BOOTMODE and MCU_BOOTMODE values.

    These values being corresponding to the UART boot mode will trick the ROM code into thinking that the bootmode was actually UART.

    This can be extended to the eMMC boot mode change as well. Refer function "Change_bootmode_to_eMMC".

    Refer the attached gel.txt.

    2870.gel.txt
    /* This function changes the BOOTMODE to UART boot mode */
    hotmenu Change_bootmode_to_UART(){
    
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 0..\n");
        *((unsigned int *)(0x43001008)) = 0x68EF3490;
        *((unsigned int *)(0x4300100C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 0.. DONE!\n");
    
        GEL_TextOut("Changing CTRLMMR_WKUP_DEVSTAT to 0x38..\n");
        *((unsigned int *)(0x43000030)) = 0x38;
        GEL_TextOut("Changing CTRLMMR_WKUP_DEVSTAT to 0x38.. DONE!\n");
    
        GEL_TextOut("Unlocking MAIN CTRLMMR Partition 0..\n");
        *((unsigned int *)(0x101008)) = 0x68EF3490;
        *((unsigned int *)(0x10100C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking MAIN CTRLMMR Partition 0.. DONE!\n");
    
        GEL_TextOut("Changing CTRLMMR_MAIN_DEVSTAT to 0x0..\n");
        *((unsigned int *)(0x100030)) = 0x0;
        GEL_TextOut("Changing CTRLMMR_MAIN_DEVSTAT to 0x0.. DONE!\n");
    
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 6..\n");
        *((unsigned int *)(0x43019008)) = 0x68EF3490;
        *((unsigned int *)(0x4301900C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 6.. DONE!\n");
    
        GEL_TextOut("Issuing warm reset by writing 0x60000 to CTRLMMR_WKUP_MCU_WARM_RST_CTRL..\n");
        GEL_TextOut("Board will boot in UART boot mode now, look for CCCC... on MCU UART!!\n");
        *((unsigned int *)(0x4301817C)) = 0x60000;
    }
    
    /* This function changes the BOOTMODE to eMMC boot mode */
    hotmenu Change_bootmode_to_eMMC(){
    
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 0..\n");
        *((unsigned int *)(0x43001008)) = 0x68EF3490;
        *((unsigned int *)(0x4300100C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 0.. DONE!\n");
    
        GEL_TextOut("Changing CTRLMMR_WKUP_DEVSTAT to 0x8..\n");
        *((unsigned int *)(0x43000030)) = 0x8;
        GEL_TextOut("Changing CTRLMMR_WKUP_DEVSTAT to 0x8.. DONE!\n");
    
        GEL_TextOut("Unlocking MAIN CTRLMMR Partition 0..\n");
        *((unsigned int *)(0x101008)) = 0x68EF3490;
        *((unsigned int *)(0x10100C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking MAIN CTRLMMR Partition 0.. DONE!\n");
    
        GEL_TextOut("Changing CTRLMMR_MAIN_DEVSTAT to 0x1..\n");
        *((unsigned int *)(0x100030)) = 0x1;
        GEL_TextOut("Changing CTRLMMR_MAIN_DEVSTAT to 0x1.. DONE!\n");
    
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 6..\n");
        *((unsigned int *)(0x43019008)) = 0x68EF3490;
        *((unsigned int *)(0x4301900C)) = 0xD172BC5A;
        GEL_TextOut("Unlocking WKUP CTRLMMR Partition 6.. DONE!\n");
    
        GEL_TextOut("Issuing warm reset by writing 0x60000 to CTRLMMR_WKUP_MCU_WARM_RST_CTRL..\n");
        GEL_TextOut("Board will boot in UART boot mode now, look for CCCC... on MCU UART!!\n");
        *((unsigned int *)(0x4301817C)) = 0x60000;
    }

    Regards

    Karan