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.
Hi,
I'm working with the F28335 EP micro.
I work with linker file that save and run the code in flash memory.
Now I'm trying to use the sprintf function but when the micro execute it the system generate and exception and finish to work.
I search on internet and I see that is a common problem. I follow also some threads on the forum as (link ) but it do not help me.
I changed in the linker the stack to 0x800 and the heap size to 0x800 but it still do not work.
I noted that if I write the in this way "sprintf(buff, "Test");" it works. But if I write the function in this way "sprintf(buff, "Test %d", var);" it fails and generate an exception.
I try with all the suggestion that I found on the forum but I did not able to use the sprintf in my project.
Thank you very much for your help.
Regards,
Andrea
Yes,
I still having the problem with sprintf.
I increase the heap and and stack size as suggested in some forum but did not work for me.
Have you some suggestions for me?
Thank you.
Best regards,
Andrea
Hi Whitney,
thank you very much for your support and sorry for the delay but I have to go forward in my project.
Today in order to answer to your question I did further tests.
My code is the following:
unsigned char ExploerF28335_Setup()
{
unsigned char explorerF28335_setup_status = EXPL_F28335_NO_ERROR;
char buff[50];
unsigned char temp_test = 10;
ExploerF28335_InitIO();
ExploerF28335_InitTimer();
ExploerF28335_InitSCI();
sprintf(buff,"Test printf"); /*This function go weel and the program go forward*/
SCIX_SendString(SCI_A_ID, &buff[0]);
sprintf(buff,"Test printf %d", temp_test); /*This function do not work and cause
SCIX_SendString(SCI_A_ID, &buff[0]);
#if DEBUG_MODE
SCIX_SendString(SCI_A_ID, "Hello I'm the TI explorer board kit\n");
SCIX_SendString(SCI_A_ID, "Board IO Init complete\n");
SCIX_SendString(SCI_A_ID, "Timer Init complete\n");
SCIX_SendString(SCI_A_ID, "SCI Init complete\n");
#endif
return(explorerF28335_setup_status);
}/**/;
I noted that the first sprintf go well while the second sprintf has a uncontrollable behavior and block the microcontroller.
I attach to two images of my debug setup and steps before and after execution.
Hi Whitney,
thank you for your post.
In this moment I'm busy with documentation of the project.
I did only the test 1 and 2 but I got the same issue. I tried also to flash the micro and run the application without debugger , so without brekpoints, but when executed the sprintf fails in same way.
The next week I want to check the point 3. I think that it could be a right step in debug procedure.
I'm sorry for the delay.
Thank you again for your support and for your suggestions.
Regards,
Andrea