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

Part Number: TMS570LC4357

Hello, I've got a problem while running a program using FreeRTOS and loading it throught the bootloader. A program without FreeRTOS works perfectly, but when I use FreeRTOS in the application the program doesn't work. I'm able to load it but when I put the RUN command it doesn't work. What should I do? Thank you

Here you can find the application linker settings

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Linker Settings */
--retain="*(.intvecs)"
/*----------------------------------------------------------------------------*/
/* Memory Map */
MEMORY
{
VECTORS (X) : origin=0x00010020 length=0x00000040
/*sector 4/5 are used for application */
FLASH_CODE (RX) : origin=0x00010060 length=0x80000 - 0x40 fill=0xFFFFFFFF
FLASH0 (RX) : origin=0x00090020 length=0x00200000 - 0x18000
FLASH1 (RX) : origin=0x00300020 length=0x00200000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0007EB00
}
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
.text align(32) : {} > FLASH_CODE
.const align(32) : {} > FLASH_CODE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

An here there's the bootloader intvecs.asm

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.sect ".intvecs"
.arm
;-------------------------------------------------------------------------------
; import reference for interrupt routines
.ref _c_int00
.ref phantomInterrupt
.def resetEntry
;-------------------------------------------------------------------------------
; interrupt vectors
resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

If you need any additional files please ask me, I will provid them

Thank you again

  • Hi Lorenzo,

    Can you please refer below thread:

    (+) TMS570LC4357: freertos bootloader application getting problem in I2C - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    This is a recent thread similar to yours and solved by me. Please do apply the modifications suggested in above thread.

    --

    Thanks & regards,
    Jagadish.

  • Ok, after trying some solutions the working solution is:

    Modify the HL_sys_link.cmd of the APPLICATION like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*----------------------------------------------------------------------------*/
    /* Memory Map */
    MEMORY
    {
    VECTORS (X) : origin=0x00010020 length=0x00000020 vfill = 0xffffffff
    KERNEL (RX) : origin=0x00010040 length=0x00008000 vfill = 0xffffffff
    FLASH0 (RX) : origin=0x00018040 length=0x001F7FE0 vfill = 0xffffffff
    FLASH1 (RX) : origin=0x00210020 length=0x00200000 vfill = 0xffffffff
    STACKS (RW) : origin=0x08000000 length=0x00000800
    KRAM (RW) : origin=0x08000800 length=0x00000800
    RAM (RW) : origin=(0x08000800+0x00000800) length=(0x0007f800 - 0x00000800)
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I had to recalculate the origin of the memory because of the offset of 0x00010020 fot the bootloader.

    So just start from 0x00010020 and then sum the lenght with Windows exadecimal calculator to find the next origin.

    Remeber to do vfill to avoid ECC errors.

    I didn't have to modify the SECTIONS.

     

    The next thing to do is to modify BOOTLOADER code

    This is HL_sys_intvecs.asm

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    .sect ".intvecs"
    .arm
    ;-------------------------------------------------------------------------------
    ; import reference for interrupt routines
    .ref _c_int00
    .ref phantomInterrupt
    .def resetEntry
    ;-------------------------------------------------------------------------------
    ; interrupt vectors
    resetEntry
    b _c_int00
    undefEntry
    b #0x10018
    svcEntry
    b #0x10018
    prefetchEntry
    b #0x10018
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I modified the original one, changing to #0x10018 to redirect the varius things like interrupts, whatchdogs, FreeRTOS functions and so on

    It's working now, thank you