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: How to enable RTI in UART bootloader ?

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi TI Team,

I need to create a RTI for runnable function inside the UART bootloader.

I have enabled the RTI driver ,  VIM Channel 0-31 as RTI Compare 1 is enabled , RTI Compare Compare 1 period as 20.000 ms . 

initialization calls in main file 

rtiEnableNotification(rtiREG1,rtiNOTIFICATION_COMPARE1);

_enable_IRQ_interrupt_();
rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK1);


RTI Notification function is created, but I didn't get any notification in rtiNotification in UART bootloader code 

void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
{
gioToggleBit(gioPORTB,2);
}

So it is reset the code from _c_int00 after _enable_IRQ_interrupt_(); are else it don't call rtiNotification.

Thanks in advance

Santhosh

  • Hi Santhosh,

    There are four compare registers: 

    #define rtiNOTIFICATION_COMPARE0 1U

    #define rtiCOMPARE0 0U

    To enable compare0, please use the following code:

    /* Initialize RTI */
    rtiInit();

    /* Enable RTI compare 0 notification */
    rtiEnableNotification(rtiREG1, rtiNOTIFICATION_COMPARE0);

    /* Start counter */
    rtiStartCounter(rtiREG1, rtiCOUNTER_BLOCK0);

  • Hi QJ Wang,

    RTI is configured in HalCoGen for compare 0 and Counter 0 as per your previous reply.

    RTI Compare 0 is set

    RTI Compare 0 is enable for interrupt

    RTI driver is selected.

    /*RTI*/ defined in before main 
    #define rtiNOTIFICATION_COMPARE0 1U

    #define rtiCOMPARE0 0U

    /*RTI*/ Called in main initialization

    /* Enable RTI compare 0 notification */
    rtiEnableNotification(rtiREG1, rtiNOTIFICATION_COMPARE0);
    /* Start counter */
    rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0);

    /*RTI*/ rtiNotification is not working . RTI is not calling every 10ms .

    void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
    {
    gioToggleBit(gioPORTB,2);
    }

    Did we have any RTI in Bootloader to work ? 

    How to send packets in every 20ms using scheduler?

    Thanks in Advance

    Santhosh

  • Hi QJ Wang,

    Can we do Y modem in UART_Download with Ymodem_Receive in 20ms scheduler with PMIC  TPS65381 ?

    If we implement PMIC in bootloader the UART transfer is stuck in-between.

    How to acknowledge  the PMIC in between the packet data transfer in Ymodem receive and transmit.

    Is it possible to implement the both UART bootloader with PMIC External Watchdog ?

    Thanks in advance,

    Santhosh

  • Hi QJ Wang,

    The RTI rtiNotification is working after removed memcpy for .const section in bl_main.c and HL_sys_link.cmd

    bl_main.c

    /* Copy the .const section */
    // memcpy(&constRunStart, &constLoadStart, (uint32)&constLoadSize);

    HL_sys_link.cmd

       .const   : {} load=FLASH0 , run = RAM, LOAD_START(constLoadStart), RUN_START(constRunStart), SIZE(constLoadSize)   /*Initialized constant data (e.g. const flash_sectors[..] = )*/

    replaced as 

     .const   : {} load=FLASH0 

    Is this affect the Ymodem transmission receive and transmit ?

    Can you please reply as soon as possible 

    Thanks in advance

    Santhosh

  • Did we have any RTI in Bootloader to work ? 

    How to send packets in every 20ms using scheduler?

    I don't enable the RTI in bootloader. In UART bootloader, the TMS570 bootloader receives data packets and the Host sends message. I don't know how to send packets in every 20ms. 

  • HI,

    Can you use this way to avoid allocating all the const to RAM?

    .intvecs : {} palign=8 > VECTORS
    flashAPI:
    {
         .\Boot\Fapi_UserDefinedFunctions.obj (.text, .data)
          .\Boot\bl_flash.obj (.text, .data)
            --library = F021_API_CortexR4_BE_L2FMC.lib (.text, .data)
    } palign=8 load = FLASH0 |FLASH1, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)

    .text : {} palign=8 > FLASH0 |FLASH1
    .const : {} palign=8 load=FLASH0 |FLASH1
    .cinit : {} palign=8 > FLASH0 | FLASH1
    .pinit : {} palign=8 > FLASH0 | FLASH1
    .bss : {} > RAM /* Uninitialized global and static variables */
    .data : {} > RAM /* Global and static non-const variables that are explicitly initialized. */
    .sysmem : {} > RAM /* Memory pool (heap) for dynamic memory allocation */

  • Hi QJ Wang,

    I have used FLASH_API for only FAPI and boot uses FLASH 0 is it okay because FLASH 1 is used by only APPLication 

    .intvecs : {} > VECTORS
    flashAPI:
    {
    .\MCAL_Lib\source\Fapi_UserDefinedFunctions.obj (.text, .data)
    .\Boot\bl_flash.obj (.text, .data)
    --library = F021_API_CortexR4_BE_L2FMC.lib (.text, .data)
    } palign=8 load = FLASH_API, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)


    .text : {} > FLASH0 /*Initialized executable code and constants*/
    .const   : {} load=FLASH0
    .cinit : {} > FLASH0 /* Tables for explicitly initialized global and static variables */
    .pinit : {} > FLASH0 /* C++ global constructor addresses */

    .bss : {} > RAM /* Uninitialized global and static variables */
    .data : {} > RAM /* Global and static non-const variables that are explicitly initialized. */
    .sysmem : {} > RAM /* Memory pool (heap) for dynamic memory allocation */

    palign = 8 is needed ?

    Can you check and confirm the HL_sys_link.cmd file ?

    Thanks in advance 

    Santhosh

  • palign = 8 is needed ?

    Yes, it is good to have it. 

    palign=8 tells the linker to place an output sections (flashAPI, .txt, .const, .cinit, etc) at an address that falls on an 8-byte boundary, and ensures that the size of the output section is a multiple of 8 bytes.

    Can you check and confirm the HL_sys_link.cmd file

    It looks ok to me