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: TMS570LC4357: CAN Bootloader flashing FreeRTOS

Part Number: TMS570LC4357

I am working on the bootloader(baremetal) and an application based on safeRTOS. I am placing bootloader Vector table @ address 0x00000000 and application vector table @ 0x00020000. After jumping on the application I am able to find my vector table and perform the basic system initialization correctly.

As soon as I start the scheduler(more specific when i start the portSTART_FIRST_TASK) it got stuck. This problem is with OS based application not with baremetal application.

Also could you please share your linker file of Bootloader and application.

Below are the linker file of both for reference 

#Bootloader Linker

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

#Application 

VECTORS (X) : origin=0x00020000 length=0x00000080 vfill = 0xffffffff
KERN_FUNC (RX) : origin=0x00020080 length=0x0000ff80 vfill = 0xffffffff
FLASH0 (RX) : origin=0x00030000 length=0x001F0000 vfill = 0xffffffff
FLASH1 (RX) : origin=0x00220000 length=0x00200000 vfill = 0xffffffff
STACKS (RW) : origin=0x08000000 length=0x00001800
KERN_DATA (RW) : origin=0x08001800 length=0x00000800
RAM (RW) : origin=0x08002000 length=0x0007E000

 

  • Hi Aman,

    RTOS supports two type of tasks: privileged task and unprivileged tasks. A privileged task has access to the entire memory map, but an unprivileged task only has access to its stack. A task that is running in unprivileged mode cannot set itself into privileged mode.

    Does your task access a MPU protected region? Can you try the same operations in a privileged task?

    I am not familiar with safeRTOS.

  • Hi QJ,

    Thanks for your reply!!

    Could you please check the linker file that I have attached reason being that on debug, got the errERROR_IN_VECTOR_TABLE error of xTaskStartScheduler(). Facing the same with freeRTOS as well. 

  • Linker cmd looks ok. But the .intvecs only takes 0x20 bytes, please change 

    VECTORS (X) : origin=0x00020000 length=0x00000080 vfill = 0xffffffff

    to

    VECTORS (X) : origin=0x00020000 length=0x00000020 vfill = 0xffffffff

    The unused flash doesn't have valid ECC value.

    Can you share your section configuration in your application linker cmd file? Are the sections 32 byte aligned? 

  • Sorry for the delay!!

    .intvecs palign(32), START( lnkStartFlashAddress ),START( lnkKernelFuncStartAddr )
    fill =0xffffffff {} > VECTORS


    .kernel_function END( lnkKernelFuncEndAddr ) :
    {
    *(KERNEL_FUNCTION)
    } > KERN_FUNC

    .unpriv_flash palign(32), END( lnkEndFlashAddress ) :
    {
    *(.text)
    *(.const)
    } > FLASH0 | FLASH1

    .cinit align(32) : {} > FLASH0 | FLASH1
    .pinit align(32) : {} > FLASH0 | FLASH1

    STACK_DATA START( lnkKernelDataStartAddr ) : {} > STACKS
    KERNEL_DATA END( lnkKernelDataEndAddr ) : {} > KERN_DATA
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM

    /* These configuration settings are for the SafeRTOS TMS570LC43x FPU demonstration
    * project. They are included as a demonstration of how task data can be
    * grouped together into known locations, therefore enabling MPU regions to
    * be defined. */


    __idle_hook_data__
                                  : START( lnkIdleTaskDataStartAddr )
                                 {} > RAM palign( 0x20 )
    __block_tim_data__
                                  : START( lnkBlockTimeTestDataStartAddr )
                                 {} > RAM palign( 0x20 )
    __block_q_data__
                                  : START( lnkBlockQueueTestDataStartAddr )
                                 {} > RAM palign( 0x80 )
    __dynamic_task_data__
                                 : START( lnkDynamicTestDataStartAddr )
                                 {} > RAM palign( 0x40 )
    __led_task_data__
                                  : START( lnkLEDFlashTestDataStartAddr )
                                  {} > RAM palign( 0x20 )
    __poll_q_data__
                                  : START( lnkPollQTestDataStartAddr )
                                  {} > RAM palign( 0x20 )
    __binary_semaphore_task_data__
                                  : START( lnkSemaphoreTestDataStartAddr )
                                  {} > RAM palign( 0x40 )
    __create_delete_data__
                                  : START( lnkDeathTestDataStartAddr )
                                  {} > RAM palign( 0x20 )
    __com_test_data__
                                  : START( lnkComTestDataStartAddr )
                                  {} > RAM palign( 0x20 )
    __maths_test_data__
                                  : START( lnkMathsTestDataStartAddr )
                                  {} > RAM palign( 0x40 )
    __counting_semaphore_task_data__
                                  : START( lnkCountSemTestDataStartAddr )
                                  {} > RAM palign( 0x40 )
    __notified_task_data__
                                  : START( lnkTaskNotifyDataStartAddr )
                                 {} > RAM palign( 0x20 )
    __timer_demo_task_data__
                                 : START( lnkStartTimerTestData )
                                 {} > RAM palign( 0x800 )
    __rec_mutex_data__
                                 : START( lnkRecMutexDataStartAddr )
                                {} > RAM palign( 0x400 )
    __event_poll_demo_data__
                                 : START( lnkEventPollDemoDataStartAddr )
                                 {} > RAM palign( 0x40 )

  • The SafeRTOS requires access to SVC (vPortSVCHandler) interrupt etc. If the interrupt handler can not be found at the expected location, you will get errERROR_IN_VECTOR_TABLE error.

    The "VECTOR_TABLE" means the interrupt vector table.

    My guess is that the branch address in your bootloader exception vector table is not correct.

    Please correct them as below:

    b _c_int00
    b 0x20000 - 0x8 = 0x1FFF8
    b 0x20000 - 0x8 = 0x1FFF8
    b 0x20000 - 0x8 = 0x1FFF8
    b 0x20000 - 0x8 = 0x1FFF8