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-AM263PX: Implementation of a TFTP server in the SBL

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

Tool/software:

Hi,

I’m working with the AM263Px CC evaluation board. I’m using CCS version 12.8.1 and SDK installed is am263px_10_00_00_35.

Based on the examples Enet LwIP HTTP Server On Bare Metal (No-RTOS) and OSPI Flash IO, I have implemented an UDP TFTP server. It receives a binary file and writes it to the flash. I now implemented that code in a bootloader (sbl) to be able to update the application that is supposed to run. I chose the sbl_ospi because it already has the functionality to run an application that has been flashed to the EVM flash. I called that new bootloader sbl_ospi_enet. I added enet to the sbl_ospi syscfg and the TFTP server to the source code. The bootloader waits for a command to run the application (0x4b 0x01 0x20) that has been flashed before (together with the sbl) (1) or to flash a new application (0x4b 0x01 0x21) and overwrite the existing (2).  This works in certain circumstances.

  1. Only nortos applications run.
    I tested with a couple of applications from the examples folder. Some of them work and others don’t.
    Nortos applications gpio_led_blink and hello_world: The sbl completes with loading the image and switching to the application.
    Freertos application hello_worl: The sbl hangs when initializing core R5FSS0_0. (line 177 in main.c)
  2. I use uart_uniflash.py to flash the EVM. The idea of the sbl is to overwrite the flashed data (appimage) if necessary, before the sbl finds and loads it. If both sbl_ospi_enet and the application are flashed, the bootloader does not run at all. If only sbl_ospi_enet is flashed (no application), the bootloader runs. Without the application, (1) can no longer be selected or executed. (2) works as described above.

 

I could need some help to fix the problems above. Can I do like this at all? Have I missed or misunderstood something?

Questions that I have are:

  • Where do I have to place the tftp server in main?
  • What MPU ARMv7 settings and memory configurations in syscfg are needed?

Regards,

Wega

sbl_ospi_enet.zip

  • Hi, don't start investigating. I found out that the sbl is too big (0x8D000) to fit into the memory provided (0x60000000000 – 0x60081000). UART Uniflash did not warn, but TI Uniflash does! I defined a new offset for the application at 0xA0000. Some of the problems I had in my post are solved. I still have some questions related to this bootloader, but before that I need to investigate further.

  • Hi Wega,

    Please let me know what further questions you have on boot loader

  • Hi Nilabh,

     After fixing the application offset in sbl_ospi_enet I’m able to:

    • flash the sbl and the application (with UART uniflash eller TI uniflash, for the example I flashed gpio_led_blink_nortos),
    • run the sbl,
    • optionally run the flashed application (gpio_led_blink_nortos, see Terminal output - gpio_led_blink - preflashed.txt)
    • or flash a new application using tftp and run it (hello_world_nortos, see Terminal output - hello_world - iap_tftp.txt).

    There are two problems that I’d like your help with:

    1. The bootloader is not rebooting (see Terminal output - reboot_error.txt). This capability was somehow lost during the conversion from sbl_ospi to sbl_ospi_enet. I suspect that it is a setting in syscfg. But I don’t know how to fix it. Every time I want to restart the bootloader I have to flash it. The reset button or power off/on is not working.
    2. Free-RTOS applications, flashed with uniflash together with the sbl or with tftp in the sbl, do not run. The sbl hangs when initializing core R5FSS0_0 in line 177 in main.c (see Terminal output - hello_world_freertos - preflashed - error.txt and Terminal output - hello_world_freertos - iap_tftp - error.txt). This is no problem in the sbl_ospi from which sbl_ospi_enet is derived. I guess that the error is somehow caused by changes in syscfg.

    Here comes an update of sbl_ospi_enet:

    /cfs-file/__key/communityserver-discussions-components-files/908/8015.sbl_5F00_ospi_5F00_enet.zip

    Thanks for help with these problems.

    Regards,

    Wega

  • Hi Wega,

    On the SBL being overwritten, can you check in the Application memory map , is it overwriting the SBL or may be the tftp is overwriting the SBL?

  • Hi Nilabh,

    I could fix problem #2 by increasing the SBL memory region size in the application because SBL with enet does not fit in the given region size of 0x40000 bytes.

    But that did not fix the rebooting problem. Do you have some ideas?

    Regards,

    Wega

  • Hi Wega,

    I am not able to root cause this yet, Do you see this need for reflashing on every run cycle or with firmware update with SBL enet only?

  • Hi,

    it's a memory problem. I might have fixed it. Further tests are required.

  • Sure Wega, I am closing this thread now. Feel free to open a new one in case further help is needed.