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.

RM46L852: flash issue with ethernet bootloader

Part Number: RM46L852
Other Parts Discussed in Thread: UNIFLASH, HALCOGEN, TMS570LS1114

Hi there,

I am struggling to adapt ethernet bootloader to my board. The bootloader seemed to be fine, because it said "Application was loaded successful!" after data transmission was completed.
But I checked application flash area, it has "fffffff...." .??? Just in case, I run ethernet bootloader without JTAG debugger. After data was transmitted , I checked application memory area with uniflash. I also saw "fffffffff.....".
But data close to APP_STATUS_ADDRESS was updated from "ffff..." to "5A5A5A5A 00020000 000360E0 20002021".

What should I do to write application image into flash memory?

I appreciate any advice.

Thanks.

  • Hello,

    I just modified following sentence in bl_flash.c, then flash memory was updated.

    //Bank here is not used. We calculate the bank in the function based on the Flash-Start-addr
    uint32_t Fapi_BlockProgram(uint32_t Flash_Address, uint32_t Data_Address, uint32_t SizeInBytes)
    {
    register uint32_t src = Data_Address;
    register uint32_t dst = Flash_Address;
    uint32_t bytes;

    if (SizeInBytes < 32) ------------------->16
    bytes = SizeInBytes;
    else
    bytes = 32; ---------------------------------->16

    Then next problem is my application seems to be into malfunction. I would like to confirm if my process is correct.

    1) My application work with RTOS (Generated by HALCoGen), link cmd for making application (bootloader write image)

    I changed flash memory address, VETORS(X) origin from 0x00000000 to 0x00020020 and so on.

    MEMORY
    {
    VECTORS (X) : origin=0x00020020 length=0x00000020 vfill = 0xffffffff
    KERNEL (RX) : origin=0x00020040 length=0x00008000 vfill = 0xffffffff
    FLASH0 (RX) : origin=0x00028040 length=0x00117FC0 vfill = 0xffffffff
    STACKS (RW) : origin=0x08000000 length=0x00000800
    KRAM (RW) : origin=0x08000800 length=0x00000800
    RAM (RW) : origin=(0x08000800+0x00000800) length=(0x0002F800 - 0x00000800)

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (3) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Section Configuration */

    SECTIONS
    {
    .intvecs : {} > VECTORS
    /* FreeRTOS Kernel in protected region of Flash */
    .kernelTEXT : {} > KERNEL
    .cinit : {} > KERNEL
    .pinit : {} > KERNEL
    /* Rest of code to user mode flash region */
    .text : {} > FLASH0
    .const : {} > FLASH0
    /* FreeRTOS Kernel data in protected region of RAM */
    .kernelBSS : {} > KRAM
    .kernelHEAP : {} > RAM
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM
    FEE_TEXT_SECTION : {} > FLASH0
    FEE_CONST_SECTION : {} > FLASH0
    FEE_DATA_SECTION : {} > RAM

    2) I turned flash ECC off, because a debugger seems to get malfunction: when bootloader wrote image, restarted debugger, then PC jumped into application. After that debugger worked not well.

    I think this is caused by my setting wrong. We could use flash ECC even process move from bootloader to application, right ?

    If yes, link cmd should be like what ?


    Thanks.

    Yamai

  • Hi,

    I keep trying fix to my flash issue of bootloader.

    RTOS uses svcEntry (vPortSWI routine) for some reason. This was a root cause of my application (based on RTOS) is corrupted.

    I referred SPNA236 and "TMS570LS1114: SPNA236 exception handling between bootloader and application".

    In my case, just changed destination address from svcEntry to APP_STATUS_ADDRESS + 0x8 at interrupt vectors is enough, I think.

    Currently, my APP_STATUS_ADDRESS is 0x0020020, so that I changed like following,

    svcEntry
    b svcEntry

           |

    ;svcEntry
    b #0x0020028

    After compiling code, I needed to change code from b #0x0020028 to b #0x0020018, based on following compile result.

    (Why ? I am not familiar with arm assembler.)

    My application after image was updated with bootloader worked. Rest of my flash issue mainly is to turn flash ECC on.

    I appreciate any advice.

    Thanks.

    Yamai

  • Hi Yamai,

    Did you try any small application image like LED blinky or UART project before trying RTOS project image? 
    If this project works perfectly then we can focus on RTOS project. 

    --

    Thanks,

    Jagadish.

  • Hello Jagadish,

    Thanks in advance.

    No, I did not try "LED blink".


    My application (with RTOS) seems to work well after bootloader interrupt vectors was changed, I described in former reply.

    I will check it out more. I will try small application when I find any malfunction.

    I have one question regarding flash ECC.

    I am not sure how to make application image, it will be updated by bootloader.

    Application standalone project link.cmd has:

    ECC {
    algoR4F021 : address_mask = 0x003ffff8 /* Address Bits 21:3 */
    hamming_mask = R4 /* Use R4 build in Mask */
    parity_mask = 0x0c /* Set which ECC bits are Even and Odd parity */
    mirroring = F021 /* RM4x and TMS570LSx are build in F021 */
    }

    :

    ECC_FLA0 (R) : origin=(0xf0400000 + (start(FLASH0) >> 3))
    length=(size(FLASH0) >> 3)
    ECC={algorithm=algoR4F021, input_range=FLASH0}

    But some command put on post process to create bin file, that makes huge size image (* GB) when using link.cmd described above.

    Is it enough to apply link cmd without ECC staff, even flash ECC is active ?

    Thanks.

    Yamai

  • Hi Jagadish,

    I referred some post topics in this forum, (thanks)  I was able to "enable flash ecc" of ethernet bootloader, provided by TI.

    I added flash ecc disable before checking memory, re-enable when it is done, in Flash_Erase_Check().

    Link cmd did not need to have ECC command to make application binary file. My application worked with flash ecc.

    I would like to close this topic.

    Thanks.

    Yamai