Tool/software: TI C/C++ Compiler
There is not way to reset a micro due to some init error. Going through the debugging the function in autoinit.h function, system runs to BREAKPOINT_2 (See below), I press on run, but the system never goes back to the BREAKPINT_1, but it display an error in console
Console
Assertion failed, (!((*((volatile uint16_t *)((uint16_t)baseAddress + (0x0000)))) & (0x0002))), file ../driverlib/adc12_a.c, line 1
Code referenced above. What can I do?
/*****************************************************************************/
/* cinit */
/*****************************************************************************/
static __inline __attribute__((always_inline)) void run_cinit(void)
{
#if defined(__TI_EABI__) && \
defined(__MSP430__) && \
defined(__LARGE_CODE_MODEL__) && !defined(__LARGE_DATA_MODEL__)
/*------------------------------------------------------------------------*/
/* 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)
{
unsigned long const *table_ptr = (unsigned long const *)__TI_CINIT_Base;
unsigned long const *table_limit = (unsigned long const *)__TI_CINIT_Limit;
while (table_ptr != table_limit)
{
unsigned long load_addr = *table_ptr++;
unsigned long run_addr = *table_ptr++;
unsigned char handler_idx = __data20_read_char(load_addr++);
handler_fn_t handler = __TI_Handler_Table_Base[handler_idx];
handler(load_addr, run_addr);
}
}
#elif defined(__TI_EABI__) || defined(__ARM_EABI__)
/*------------------------------------------------------------------------*/
/* 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 defined(__FROZEN__)
/*------------------------------------------------------------------------*/
/* For C7X, use _symval() to force absolute addressing on these symbols, */
/* otherwise we will end up with an incorrect value if we rely on */
/* position-independent, PC-relative addressing. This is a temporary */
/* workaround. See Jira COMPILE-362 for more information. */
/*------------------------------------------------------------------------*/
if (_symval(__TI_Handler_Table_Base) != _symval(__TI_Handler_Table_Limit))
{
char *const *table_ptr = (char *const *)_symval(__TI_CINIT_Base);
char *const *table_limit = (char *const *)_symval(__TI_CINIT_Limit);
#else
if (__TI_Handler_Table_Base != __TI_Handler_Table_Limit)
{
char *const *table_ptr = __TI_CINIT_Base;
char *const *table_limit = __TI_CINIT_Limit;
#endif
while (table_ptr != table_limit) // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< BREAKPOINT_1
{
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); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< BREAKPOINT_2
}
}
#else
/*------------------------------------------------------------------------*/
/* Process Cinit table for COFF. */
/*------------------------------------------------------------------------*/
#ifdef _TMS320C6X
#define ALIGN_TYPE uintptr_t
#define ALIGN_MASK 0x7
#elif defined(__MSP430__)
#ifdef __LARGE_DATA_MODEL__
#define ALIGN_TYPE unsigned long
#else
#define ALIGN_TYPE unsigned
#endif
#define ALIGN_MASK 0x1
#else
#define ALIGN_TYPE uintptr_t
#define ALIGN_MASK 0x3
#endif
#define ALIGN_PTR(ptr) \
((unsigned const *)(((ALIGN_TYPE)ptr + ALIGN_MASK) & ~ALIGN_MASK))
unsigned const *recptr = (unsigned const *)__cinit__;
int length;
if (recptr != (unsigned *)-1)
while ((length = *recptr++) != 0)
{
#if defined(__MSP430__) && defined(__LARGE_DATA_MODEL__)
char *to = (void *)*(unsigned long const *)recptr;
recptr += 2;
#else
char *to = (void *)*recptr++;
#endif
char *from = (void *)recptr;
memcpy(to, from, length);
from += length;
recptr = ALIGN_PTR(from);
}
#endif
}
