In my current project, I am working on a TMS320C6748 and am in the process of implementing UART functionality. The UART is working great, and I decided to wrap it up a bit for my specific application, so I decided to have any messages sent to the chip be read in groups of 4 bytes. To do this, I have it set up so that whenever there is an interrupt raised for the FIFO meeting the trigger level, the application grabs each byte in the buffer and stores it in a vector (to be further compacted into "message" objects and acted on).
However, I have found that while I can create vectors, I cannot use their functions. In particular, push_back() causes the application to abort and run to its exit() function. I read in another thread that this might be caused by having no heap memory available, so I made sure to check that first and set my heap size to 0x2000, but this did not solve my problem.
Any suggestions for what might be happening? Below is the related part of the code:
void cUartManager::handleCommands()
{
std::vector<uint8_t> words;
uint8_t temp;
uint8_t count;
// Grab all bytes in FIFO buffer
while( CHKBIT( DEBUG_PORT->LSR, DR ) )
{
// Read a byte and place it into vector
rxByte( &temp );
words.push_back( temp ); // Crashes here
}
// Find the size of the vector
count = words.size();
.... etc
}
Thanks,
Charles