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.
Hi
Customer meet problem when use python script to program flash. They use customized flash on LP-AM263x. They always get failure if image size is larger than 320KB. I checked sbl_uar_uniflash project, the buffer to receive file is much larger than 320KB. as
#define BOOTLOADER_UNIFLASH_MAX_FILE_SIZE (0x1C0000)
From the log provided by customer, it looks like device fail to receive application images.
Can you please help to exam the messages from python script?
Q1. is there anyway/document we can use CCS to debug sbl_uart_uniflash so we can get more clear insight of the issue?
Q2. What will make xmodem transaction fail? Anyway to make python script to provide more information to help debug?
Regards
Andre
More input:
I can reproduce this issue on EVM. The issue is not related to customized FLASH driver. Please refer to attached test image. I modify from GPIO blink project.
I add a empty table to increase image size larger than 512KB and program it to LP-AM263x EVM. Modified source code and linker command files are also attached.
gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.appimage
/* * Copyright (C) 2021 Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <drivers/gpio.h> #include <kernel/dpl/AddrTranslateP.h> #include <kernel/dpl/DebugP.h> #include <kernel/dpl/ClockP.h> #include "ti_drivers_config.h" #include "ti_drivers_open_close.h" #include "ti_board_open_close.h" #define EMPTY_ARRAY_SIZE (512*1024) /* * This example configures a GPIO pin connected to an LED on the EVM in * output mode. * The application toggles the LED on/off for 10 seconds and exits. */ uint8_t TEST_TABLE[EMPTY_ARRAY_SIZE] = {0}; void gpio_led_blink_main(void *args) { uint32_t loopcnt, delaySec = 1; uint32_t gpioBaseAddr, pinNum; /* Open drivers to open the UART driver for console */ Drivers_open(); Board_driversOpen(); DebugP_log("GPIO LED Blink Test Started ...\r\n"); DebugP_log("LED will Blink for %d seconds ...\r\n", (loopcnt * delaySec * 2)); /* Get address after translation translate */ gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(GPIO_LED_BASE_ADDR); pinNum = GPIO_LED_PIN; GPIO_setDirMode(gpioBaseAddr, pinNum, GPIO_LED_DIR); for (loopcnt=0; loopcnt++; loopcnt < EMPTY_ARRAY_SIZE ) { TEST_TABLE[loopcnt] = TEST_TABLE[loopcnt] ^ loopcnt; GPIO_pinWriteHigh(gpioBaseAddr, pinNum); ClockP_sleep(delaySec); GPIO_pinWriteLow(gpioBaseAddr, pinNum); ClockP_sleep(delaySec); DebugP_log("TEST_TABLE[%d]=%d\r\n",loopcnt, TEST_TABLE[loopcnt]); } DebugP_log("GPIO LED Blink Test Passed!!\r\n"); DebugP_log("All tests have passed!!\r\n"); Board_driversClose(); Drivers_close(); }
I tested several time and got the same error symptom. I also add GPIO indication in sbl_uart_uniflash.
(mcu+) andre@elevation:~/ti/mcu_plus_sdk_am263x_08_05_00_24/tools/boot$ python uart_uniflash.py -p /dev/ttyACM0 --cfg=/home/andre/ti/mcu_plus_sdk_am263x_08_05_00_24/tools/boot/app_config/gpio_led_blink_r5f0-0_am263x-lp.cfg Parsing config file ... Parsing config file ... SUCCESS. Found 3 command(s) !!! Executing command 1 of 3 ... Found flash writer ... sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang.tiimage Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_uSending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_uSending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_u Sent flashwriter /home/andre/workspace_v12/sitara_mcu/am263x/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_uart_uniflash_am263x-lp_r5fss0-0_nortos_ti-arm-clang.tiimage of size 68433 bytes in 6.82s. Executing command 2 of 3 ... Command arguments : --file=/home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang.tiimage --operation=flash --flash-offset=0x0 Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263Sending /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263 Sent /home/andre/workspace_v12/sitara_mcu/am263x/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_qspi_am263x-lp_r5fss0-0_nortos_ti-arm-clang.tiimage of size 187249 bytes in 18.62s. [STATUS] SUCCESS !!! Executing command 3 of 3 ... Command arguments : --file=/home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.appimage --operation=flash --flash-offset=0x80000 Sending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.appimage: 566981bytes [00:54, 11087.89bytes/s]recv error: getc timeout in start sequence Sending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_ledSending /home/andre/workspace_v12/sitara_mcu/am263x/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang/Debug/gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.appimage: 566983bytes [01:08, 294.71bytes/s]expected sequence 2, got (seq1=1, seq2=1), receiving next block, will NAK. recv error: purge, requesting retransmission (NAK)
Can you please check if there is any issue in SBL_UART_UNIFLASH or python script?
Regards
Andre
The programming problem already impact customer schedule, any update?
Regards
Andre
Hi AndreTseng,
Are there any changes done by user in the SBL UNIFLASH example ?
Q1. is there anyway/document we can use CCS to debug sbl_uart_uniflash so we can get more clear insight of the issue?
This FAQ tells how to debug SBL -
Q2. What will make xmodem transaction fail? Anyway to make python script to provide more information to help debug?
Unfortunately it is completely being functional on the target, there is no use in debugging the python.
The programming problem already impact customer schedule, any update?
Can you try using JTAG Uniflash option to unblock the customer ?
Best Regards,
Aakash
Aakash,
Are there any changes done by user in the SBL UNIFLASH example ?
==> I can reproduce on LP-AM263x with pre-built flash programmer, SDK8.5 TI shipped pre-built image, TI utility without any modification. Then only thing different is application image larger than 500KB. Try it on LP-AM263x, I have provide code, application image. It won't take you more than 5minutes to reproduce this issue.
Can you try using JTAG Uniflash option to unblock the customer ?
==> No. there is no JTAG interface in customer design.
Regards
Andre
With CCSDebug:
sbl_uart_uniflash fail at the last step.
status = Bootloader_xmodemTransmit(CONFIG_UART0, (uint8_t *)&respHeader, sizeof(Bootloader_UniflashResponseHeader));
Bootloader_xmodemTransmit() doesn't transmit data.
The respHeader parameters of Bootloader_xmodemTransmit() is captured as:
Field team doesn't know the detail of uniflash communication protocol. Please check and provide solution. Customer is waiting for response.
Regards
Andre
Hi AndreTseng,
I have replicated the issue. I have raised an internal ticket for the same (https://jira.itg.ti.com/browse/MCUSDK-9890). This link might not be accessible outside TI network.
For certain images (approx. 550KB), I tried increasing the timeout number -
in uart_uniflash.py of xmodem_send_receive_file function. It worked for me. The actual fix will be done by in 08.06 release itself.
Also, I tested, even with this error, the image was correctly flashed so I request you to try the application boot in QSPI boot mode. But I agree, it should've ended gracefully which it isn't.
Hope it helps.
Best Regards,
Aakash
Aakash,
Confirm adding timeout value uart_python.py solve the problem. You can close this issue now. Thanks for your help.
Regards
Andre