Part Number: TMS320F280049C
Dear community,
I am currently developing a bootloader for the TMS320F280049C. The bootloader needs to initialise the RAM it uses.
For this purpose I have written the following code
void disable_watchdog()
{
EALLOW();
WDKEY = 0x55;
WDKEY = 0xAA;
WDCR = 0x68;
EDIS();
}
static void my_memset(uint16_t *start, uint16_t fill, uint16_t count)
{
uint16_t *part_ptr = start;
uint16_t *end = start + count;
while( part_ptr < end)
{
// *part_ptr = fill;
part_ptr++;
}
}
#define EBSS_RANGE_BASE (0x0000A000)
// RAMLS4 + RAMLS5
#define EBSS_RANGE_LENGTH (2*0x000800)
int _system_pre_init()
{
// disable watchdog
disable_watchdog();
// initialize .ebss
my_memset((uint16_t *) EBSS_RANGE_BASE, 0, (uint16_t) EBSS_RANGE_LENGTH);
return 1;
}
After a cold start everything works as expected, but after a warm start the bootloader seems to hang. If I attach a debugger it states:
_system_post_cinit() 0x3FC7A5 (an error occurred: failed to parse the previous frame FP)
This problem is clearly related to the runtime length of the memset routine. When I reduce the data length the problem disappears.
I have already looked at the chapter "Device Boot Flow Diagrams" in the "Technical Reference Manual", but I do not understand what is going wrong.
Any advice is very welcome