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.

MSP430FR5959: run_cinit Function stuck in while loop

Part Number: MSP430FR5959
Other Parts Discussed in Thread: MSP430FR5969, CC1101

Tool/software:

I implemented the MSP430FRBoot example for MSP430FR5959. Since the example code is for FR5969, I followed the same memory map for the MSP430FR5959 controller in my application.

I am able to get the bootloader to boot correctly to the application space, but the application code gets stuck in the run_cinit in the while loop where the variables are being loaded into the run addresses using the CINIT tables.

I have attached a screenshot of the debug session. When I step through the while loop in the run_cinit function, the program control always ends up at address 0x000004 and I get an error message "No debug information available at address 0x04"

Can you please help me figure out why the run_cinit function goes to address 0x04 and does not complete successfully?


Code snippet is as follows:

/*------------------------------------------------------------------------*/
/* Process the compressed ELF cinit table. The format is as follows: */
/* |4-byte load addr|4-byte run addr| */
/* |4-byte load addr|4-byte run addr| */
/* */
/* Processing steps: */
/* 1. Read load and run address. */
/* 2. Read one byte at load address, say idx. */
/* 3. Get pointer to handler at handler_start[idx] */
/* 4. call handler(load_addr + 1, run_addr) */
/*------------------------------------------------------------------------*/
if (&__TI_Handler_Table_Base != &__TI_Handler_Table_Limit)
{
#if defined(__TI_EABI__) && defined(__TMS320C2000__)
char *const *table_ptr = cinit_start;
#else
char *const *table_ptr = __TI_CINIT_Base;
#endif
char *const *table_limit = __TI_CINIT_Limit;

while (table_ptr != table_limit)
{
char const *load_addr = *table_ptr++;
char *run_addr = *table_ptr++;
char handler_idx = *load_addr++;

handler_fn_t handler = __TI_Handler_Table_Base[handler_idx];
handler(load_addr, run_addr);
}
}

 ?


  • For MSP430FR5959 and FR5969 have the same FRAM and RAM size, you can just change the device of the demo code and it should work to FR5959.

  • Hi Gary, 

    To change from MSP430FR5969 to MSP430FR5959, do I just change the Variant field in the Project Properties >> CCS General>>Device>>Variant?



    Are there any additional changes required? 

    I am running into a lot of Compiler and Linker errors after just changing the device to MSP430FR5959 in the MSPBoot_FR5969_CC1101 project

  • Also, that still leaves the pending question about the run_cinit not completing execution in my original post. Once the run_cinit completes the next function to execute is the main from my application. 

    Can you please help me figure out why the run_cinit will not complete? 

  • Oh, I got it, it due to the selection compiler below and it also will add a new cmd file that you need to delete it manually. 

    #if defined (__MSP430FR5969__)
    #include "hal_spi_rf_expfr5969.h"
    #endif

    I think you can just keep it as FR5969 and just remember do not use the peripherals the FR5959 not have that also works.

    Can you please help me figure out why the run_cinit will not complete? 

    For your previous issue, few comments here:

    1. do not jump in the ISR

    2. It is better to clear the RAM(especially the stack area) before doing the jump

**Attention** This is a public forum