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.

AM2431: Flashing SBL by uart

Part Number: AM2431
Other Parts Discussed in Thread: LP-AM243, UNIFLASH

Hi all TI expert,

I successfully flashed sbl_null.release.hs_fs.tiimage on the LP-AM243 development board. However, when I switched to our product board, the flashing process consistently fails. I've set the booting mode to UART BOOT MODE, and I can see the character "C" sent from UART0. Then, I used the Python script {SDK_folder}/tools/boot/uart_uniflash.py with the following command:

python3 uart_uniflash.py -p COM4 --cfg=sbl_prebuilt/am243x-lp/default_sbl_null.cfg

he result consistently shows that the progress halts at 0% during the second command until a timeout occurs.

Upon examining the Python script, it seems that when sending the second file, the MCU does not respond with anything. Could you please help me identify potential issues? Perhaps there are hardware-related aspects causing this situation? Thank you.

  • I conducted an experiment today using a logic analyzer to monitor the UART. During the execution of the first command, I observed the MCU responding to the Python script, following the Xmodem behavior. However, when executing the second command, there was no transmission.

    As per my understanding, the first command, '--flash-writer=sbl_prebuilt/am243x-lp/sbl_uart_uniflash.release.hs_fs.tiimage,' sends the 'sbl_uart_uniflash.release.hs_fs.tiimage' to let the ROM boot receive this bootloader into RAM. After the transmission completes, the ROM boot should jump to RAM, allowing the 'sbl_uart_uniflash.release.hs_fs.tiimage' SBL to boot up and receive the subsequent SBL to store it into the external flash.

    However, something went wrong in this process. After the ROM boot received the data and jumped to RAM to start from the SBL, it seems the SBL might not be in RAM or could be stuck in the beginning, causing it to fail. This is just a hypothesis, could this be the issue?

    I have a few questions:

    1. When the ROM boot receives the first SBL, is this SBL stored in RAM?
    2. The SDK document, specifically the 'Bootflow Migration Guide,' mentions that 'sbl_*.release.tiimage' contains SYSFW, indicating that I might not need to update SYSFW into the MCU. However, in my study of the {SDK_folder}/examples/drivers/boot/sbl_uart_uniflash project, I found the 'Bootloader_socWaitForFWBoot()' function in the main function, which seems to wait for an event from the SYSFW. I'm concerned that I might have forgotten to flash SYSFW into the MCU.
    3. I attempted to build the {SDK_folder}/examples/drivers/boot/sbl_uart_uniflash project with CCS, but encountered a compile failure. Could you provide guidance on resolving this issue?

    Thank you for your assistance!

  • Hi Larry,

    In your production board which flash do you use ? Is that the same flash as LP-AM243x ?

    If not, you need to recheck the flash configurations for sbl_uart_uniflash. Before jumping to uniflash, my suggestion would be to validate the same via this flow - https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/CUSTOM_FLASH_SUPPORT_GUIDE.html

    Best Regards,
    Aakash

  • Hi Aakash,

    Thank you for your response. The production flash we're using is the W25Q16JV, which differs from the LP-AM243x.

    Both my colleague and I attempted to desolder the flash from the LP-AM243x and replace it with the W25Q16JV. After running the 'SOC Initialization Using CCS Scripting,' I loaded the 'OSPI Flash Diagnostic' example, and it worked successfully. I received the following log:

    {
    
    	"flashSize": 2097152,
    	"flashPageSize": 256,
    	"flashManfId": "0xEF",
    	"flashDeviceId": "0x4015",
    	"flashBlockSize": 65536,
    	"flashSectorSize": 4096,
    	"cmdBlockErase3B": "0xD8",
    	"cmdBlockErase4B": "0xD8",
    	"cmdSectorErase3B": "0x20",
    	"cmdSectorErase4B": "0x20",
    	"protos": {
    		"p111": {
    			"isDtr": false,
    			"cmdRd": "0x03",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 0,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 0,
    			"enableType": "0",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p112": {
    			"isDtr": false,
    			"cmdRd": "0x3B",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 0,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 8,
    			"enableType": "0",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p114": {
    			"isDtr": false,
    			"cmdRd": "0x6B",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 0,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 8,
    			"enableType": "4",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p118": null,
    		"p444s": {
    			"isDtr": false,
    			"cmdRd": "0xEB",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 2,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 0,
    			"enableType": "4",
    			"enableSeq": "0x11",
    			"dummyCfg": {
    				"isAddrReg": false,
    				"cmdRegRd":"0x00",
    				"cmdRegWr":"0x00",
    				"cfgReg":"0x00000000",
    				"shift":0,
    				"mask":"0x00",
    				"bitP":0
    			},
    			"protoCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			},
    			"strDtrCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			}
    		},
    		"p444d": {
    			"isDtr": false,
    			"cmdRd": "0xEB",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 2,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 0,
    			"enableType": "4",
    			"enableSeq": "0x11",
    			"dummyCfg": {
    				"isAddrReg": false,
    				"cmdRegRd":"0x00",
    				"cmdRegWr":"0x00",
    				"cfgReg":"0x00000000",
    				"shift":0,
    				"mask":"0x00",
    				"bitP":0
    			},
    			"protoCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			},
    			"strDtrCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			}
    		},
    		"p888s": null,
    		"p888d": null,
    		"pCustom": { 
    			"fxn": null
    		}
    	},
    	"addrByteSupport": "0",
    	"fourByteAddrEnSeq": "0x80",
    	"cmdExtType": "NONE",
    	"resetType": "0x30",
    	"deviceBusyType": "1",
    	"cmdWren": "0x06",
    	"cmdRdsr": "0x05",
    	"srWip":  0,
    	"srWel":  1,
    	"cmdChipErase": "0xC7",
    	"rdIdSettings": {
    		"cmd": "0x9F",
    		"numBytes": 5,
    		"dummy4": 0,
    		"dummy8": 0
    	},
    	"xspiWipRdCmd": "0x00",
    	"xspiWipReg": "0x00000000",
    	"xspiWipBit": 0,
    	"flashDeviceBusyTimeout": 5120000,
    	"flashPageProgTimeout": 704
    }

    Next, I loaded this JSON data into the sbl_uart_uniflash syscfg and executed the uart_uniflash.py. While the two commands executed without errors, the status result still shows a failure, as seen below:

    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!
    
    Executing command 1 of 2 ...
    Found flash writer ... sending sbl_prebuilt/am243x-lp/sbl_uart_uniflash_test.Release.hs_fs.tiimage
    Sent flashwriter sbl_prebuilt/am243x-lp/sbl_uart_uniflash_test.Release.hs_fs.tiimage of size 296762 bytes in 28.55s.
    
    Executing command 2 of 2 ...
    Command arguments : --file=sbl_prebuilt/am243x-lp/sbl_null_one_core.Release.hs_fs.tiimage --operation=flash --flash-offset=0x0
    Sent sbl_prebuilt/am243x-lp/sbl_null_one_core.Release.hs_fs.tiimage of size 260737 bytes in 50.51s.
    [STATUS] ERROR: Flash verify failed !!!
    
    All commands from config file are executed !!!

    Could you please assist me in identifying what might be wrong in this scenario?

  • Hi Larry,

    Before trying out the sbl_uart_uniflash directly, try out a simpler example like the ospi_flash_io to make sure the new flash configuration is working. Flash_verify failed means that it was not able to read back from the flash. It is possible that there is something missing in the configuration. Can you try out the ospi_flash_io example and let me know the results?

    Regards,
    Anand Mahadevan SS

  • Hi Anand, 

    Thank you for your response. I've identified the root cause—it appears that the syscfg settings were incorrect, leading to the flash verification failure. After rectifying this issue, my product board is functioning correctly now. Appreciate your assistance!

    Best regard,

    Larry