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.

MCU-PLUS-SDK-AM263X: Bug in UART Uniflasher.py

Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

When using `tools/boot/uart_uniflasher.py` with command line arguments (no cfg file), I get the following error: 
Traceback (most recent call last):

File "tools/boot/uart_uniflash.py", line 518, in main
elif linecfg.optype in ["flash-mcelf-xip"]:
UnboundLocalError: local variable 'linecfg' referenced before assignment

Took a look at uart_uniflash.py and there's an error here: 

Lines 518-519:

            elif linecfg.optype in ["flash-mcelf-xip"]:
                send_mcelf_xip(linecfg, serialport)

This should be `cmdlinecfg` not `linecfg` at this part of the code.

  • Hi Aakif,

    Thanks for pointing this out, seems like a typo. Let me get this analysed and fixed (JIRA Link for internal tracking: https://jira.itg.ti.com/browse/MCUSDK-14415). Functionality wise, when using full command to use uart_uniflash.py to flash SBL and application, I didn't observe any issues, let me know if you face any issue with Functionality (other than the mentioned part).

    Regards,
    Shaunak

  • This codepath gets hit when the binary is smaller than a megabyte, or when the optype is not "flash" or "flashverify".
    A python IDE or linter could probably catch this typo, for future reference. Thumbsup

  • Hi Aakif,

    This codepath gets hit when the binary is smaller than a megabyte, or when the optype is not "flash" or "flashverify".

    Thanks for sharing this. I'll get this fixed in upcoming releases for 2025.

    A python IDE or linter could probably catch this typo, for future referenc

    I'm not sure how this typo was missed internally. Will make sure this is taken care.

    Regards,
    Shaunak