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: Boot-loader with uC/OS-III Application

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi, 

I'm using UART boot-loader for TMS570LC4357. Normal Application code (HALCoGen) is working fine, when i'm flashing through boot-loader.  Now I'm using uC/OS-III and I created a simple task LED blinking. If I tried with uC/OS-III flashing through boot-loader, Its executing my task upto LED trun ON, next its execute  OSTimeDlyHMSM() for delay and immediately got struggle in some where, its not blinking. please see below of "HL_sys_intvecs.asm" and "sys_link.cmd " of my bootloader and uC/OS-III. Please give a solution for this?

_________________________________________________________________________________

; This is my Boot-Loader  "HL_sys_intvecs.asm" File


    .sect ".intvecs"
    .arm

;-------------------------------------------------------------------------------
; import reference for interrupt routines

    .ref _c_int00


;-------------------------------------------------------------------------------
; interrupt vectors


        b   _c_int00
        b   #0x2000F8
        b   #0x2000F8
        b   #0x2000F8
        b   #0x2000F8
        b   #0x2000F8
        b   #0x2000F8
        b   #0x2000F8


_________________________________________________________________________________

//This is my Boot-Loader  "sys_link.cmd  " File
--retain="*(.intvecs)"


MEMORY
{
    VECTORS (X)  : origin=0x00000000 length=0x00000020
    FLASH0  (RX) : origin=0x00000020 length=0x001FFFE0
    FLASH1  (RX) : origin=0x00200120 length=0x001FFFDF
    STACKS  (RW) : origin=0x08000000 length=0x00001500
    RAM     (RW) : origin=0x08001500 length=0x0007EB00

}

SECTIONS
{
    .intvecs : {} > VECTORS
    .text   align(32) : {} > FLASH0
    .const  align(32) : {} > FLASH0
    .cinit  align(32) : {} > FLASH0 
    .pinit  align(32) : {} > FLASH0 
    .bss     : {} > RAM
    .data    : {} > RAM
    .sysmem  : {} > RAM
}

_________________________________________________________________________________

_________________________________________________________________________________

; This is my uC/OS-III " HL_sys_intvecs.asm" file


    .sect ".intvecs"
    .arm

;-------------------------------------------------------------------------------
; import reference for interrupt routines

    .ref _c_int00
    .ref OS_CPU_ARM_ExceptUndefInstrHndlr
    .ref OS_CPU_ARM_ExceptSwiHndlr
    .ref OS_CPU_ARM_ExceptPrefetchAbortHndlr
    .ref OS_CPU_ARM_ExceptDataAbortHndlr
    .ref OS_CPU_ARM_ExceptIrqHndlr
    .ref phantomInterrupt
    .def resetEntry

;-------------------------------------------------------------------------------
; interrupt vectors

resetEntry
        b   _c_int00
        b   OS_CPU_ARM_ExceptUndefInstrHndlr
        b   OS_CPU_ARM_ExceptSwiHndlr
        b   OS_CPU_ARM_ExceptPrefetchAbortHndlr
        b   OS_CPU_ARM_ExceptDataAbortHndlr
        b   phantomInterrupt
        b   OS_CPU_ARM_ExceptIrqHndlr
        ldr pc,[pc,#-0x1b0]

    
;-------------------------------------------------------------------------------

_________________________________________________________________________________

//This is my uC/OS-III " sys_link.cmd  " File

--retain="*(.intvecs)"

MEMORY
{
        VECTORS (X)  : origin=0x00200100 length=0x00000020
    FLASH1  (RX) : origin=0x00200120 length=0x001FFFDF
    STACKS  (RW) : origin=0x08000000 length=0x00001500
    RAM     (RW) : origin=0x08001500 length=0x0007eb00
}

SECTIONS
{
    .intvecs : {} > VECTORS
    .text   align(32) : {} >  FLASH1
    .const  align(32) : {} >  FLASH1
    .cinit  align(32) : {} >  FLASH1
    .pinit  align(32) : {} >  FLASH1
    .bss     : {} > RAM
    .data    : {} > RAM
    .sysmem  : {} > RAM
	
    FEE_TEXT_SECTION  : {} >  FLASH1
    FEE_CONST_SECTION : {} >  FLASH1
    FEE_DATA_SECTION  : {} > RAM
}

_________________________________________________________________________________

_________________________________________________________________________________

Regards

-Arun

(arunprakash.m@mindteck.com)

  • Hello Arun,

    The cmd files and interrupt tables are fine. Did your application code blink the LED in RTI ISR? and your RTI ISR is not executed as expected, right? From your application INT vector setting, I think you use Index interrupts mode.

    TMS570 supports three interrupt mode:
    1. Index interrupts mode: After the interrupt is received by the CPU, the CPU branches to 0x18 (IRQ) or 0x1C (FIQ) to execute the main ISR. The main ISR routine reads the offset register (IRQINDEX, FIQINDEX) to determine the source of the interrupt.
    2. Register vectored interrupts mode
    3. Hardware vectored interrupts: This is the mode used in HALCoGen generated code by default. Using this mode, after the interrupt (IRQ) is received by the CPU, CPU reads the address of ISR directly from the interface with VIM (VIC port) instead of branching to 0x18. The CPU will branch directly to the ISR.

    Can you try to disable the Hardware INT mode?

    comment out the statement below in sys_startup.c to not use the VIC port.
    /* Enable IRQ offset via Vic controller */
    _coreEnableIrqVicOffset_();
  • Hello Arun,

    I assume the problem has been resolved, so I close this thread.
  • Hi QJ Wang,

    I'm really sorry for not reply as longer.

    QJ Wang : Did your application code blink the LED in RTI ISR?

    Arun : No, LEDis not Blinking in RTI ISR.

    QJ Wang :  your RTI ISR is not executed as expected, right?

    Arun : Yes.

    QJ Wang : Can you try to disable the Hardware INT mode?

    Arun : Yes I was disabled Hardware INT mode, Still its Not working.

    QJ wang : comment out the statement below in sys_startup.c to not use the VIC port.

    /* Enable IRQ offset via Vic controller */

    _coreEnableIrqVicOffset_();

    Arun : Yeah I comment out the statement, still issue not solved

    _________________________________________

    Arun : How to use Index interrupts mode??

    Best Regrads

    -Arun

  • Hello Arun,

    I noticed that the FLASH1 of memory section in your cmd file is not correct:

    MEMORY
    {
        VECTORS (X)  : origin=0x00000000 length=0x00000020
        FLASH0  (RX) : origin=0x00000020 length=0x001FFFE0
        FLASH1  (RX) : origin=0x00200120 length=0x001FFFDF
        STACKS  (RW) : origin=0x08000000 length=0x00001500
        RAM     (RW) : origin=0x08001500 length=0x0007EB00
    }
    Please change FLASH1 to:
        FLASH1  (RX) : origin=0x00200000 length=0x00200000
  • CMD file of bootloader
  • Hi QJ Wang


    At first thanks for your help, We resolved all issue & I suggest to any one regard "TMS570LC4357: Boot-loader with uC/OS-III Application" problem, Please follow the below steps
    1. Need to properly link UC/OS-III Application Vector address in Application as well as bootloader
    2. comment out the statement below in sys_startup.c to not use the VIC port. (Enable IRQ offset via Vic controller) //coreEnableIrqVicOffset_();
    3. Make sure your PINMUX init function (in Application code) is calling after jumping to application. (if its not check c_init() in startup.c)


    Please close this thread.


    Thanks
    -Arun