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.

TMS570LC4357: freertos bootloader application getting problem in I2C

Part Number: TMS570LC4357

I am working on the bootloader and an application based on RTOS. My Application is working fine with all pheripherals without booloader  , now when i am integrating the bootloader part with the application ,

the application got stuck in I2c registers  , status register is not getting cleared when sending a byte to its data register

while ((i2c->STR & (uint32)I2C_TX_INT) == 0U) 

#Bootloader Linker

VECTORS (X) : origin=0x00000000 length=0x00000020 vfill = 0xffffffff
FLASH0 (RX) : origin=0x00000020 length=0x0001FFE0 vfill = 0xffffffff
FLASH1 (RX) : origin=0x00200000 length=0x00200000 vfill = 0xffffffff
SRAM (RWX) : origin=0x08002000 length=0x0002D000
STACK (RW) : origin=0x08000000 length=0x00002000

#Application linker

VECTORS (X) : origin=0x00010020 length=0x00000080 vfill = 0xffffffff
KERN_FUNC (RX) : origin=0x000100A0 length=0x0000FF60 vfill = 0xffffffff er
FLASH0 (RX) : origin=0x00020000 length=0x001E0000 vfill = 0xffffffff

FLASH1 (RX) : origin=0x00200000 length=0x00200000 vfill = 0xffffffff
STACKS (RW) : origin=0x08000000 length=0x00001800
KERN_DATA (RW) : origin=0x08001800 length=0x00000800
RAM (RW) : origin=0x08002000 length=0x0007E0

bootloader jumps to application and all the task are running when I2c is disabled in Application , also i have called viminit() in the main of applacation 

i made changes in the vector.asm file in bootloader , application address start with address 0x00010020

resetEntry
               b _c_int00
undefEntry
              b #0x10018
svcEntry
              b #0x10018
prefetchEntry
              b #0x10018
dataEntry
            b #0x10018
            b phantomInterrupt
           ldr pc,[pc,#-0x1b0]
            ldr pc,[pc,#-0x1b0]

  • Hi Praveen,

    Is it possible to share your complete bootloader and application codes?

    You can do a private message with codes?

    I would also ask you to refer below thread

    (+) TMS570LS1224: using can bootloader not jump from bootloader to application code - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    It is same issue like you are facing, the application working correctly until bootloader is flashing 

    In this issue we commented out the map clock function in the application, then everything worked fine. Can you just comment out this function at your end also and do the testing.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    I have done some debugging and saw that when bootloader jumps to main application , it goes to C_init function in startup.c file 

    it initializes the core_init register but it does not get any reset resource so it does not get in the switch case and does not initializes the system init  and vim init

    and jumps to main , when i have called these function in main(). my application runs fine , can you just explain what it happening and does it effect on my application part

  • Hi Praveen,

    it initializes the core_init register but it does not get any reset resource so it does not get in the switch case and does not initializes the system init  and vim init

    Actually, this is expected behavior.

    I will explain why this is happenning,

    Initially the bootloader code reads the reset cause and erases the corresponding reset cause 

    You can see the function "getResetSource", here after reading the reset cause from the "SYS_EXCEPTION", we are re-writing this register to erase the reset cause.

    Due to this, when application trying to read the reset cause, it will get "NO_RESET" instead of actual reset. Because of this system init and vim init will not happen in the application code.

    The solution for this problem is that we should not verify the reset cause in the application code, instead of we should always do the system init and vim init irrespective of type of reset.

    Try to do something like below in application startup code:

    --

    Thanks & regards,
    Jagadish.

  • thanks jagadish , i will do and  check it