Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Отладка, трассировка...
Форум разработчиков электроники ELECTRONIX.ru > Микроконтроллеры (MCs) > MSP430
hash20
Подскажите а есть ли под IAR for MSP430 что-то типа trace_LOG как например здесь.

А ещё в хелпе на IAR нашел:
Цитата
Formatted output
C-SPY provides various methods for producing formatted output:

_ _message argList; Prints the output to the Debug Log window.
_ _fmessage file, argList; Prints the output to the designated file.
_ _smessage argList; Returns a string containing the formatted output.

where argList is a comma-separated list of C-SPY expressions or strings, and file is the result of the _ _openFile system macro, see _ _openFile.
Click the arrows below to display more information.
Examples
Use the _ _message statement, as in this example:
var1 = 42;var2 = 37;_ 
__message "This line prints the values ", var1, " and ", var2, " in the Log window.";This should produce this message in the Log window:


каким образом можно прикрутить вышеуказанное к проекту ????

Или подскажите вариант шустрой отладочной трассировки...

Вариант :
Код
#define DEBUG

#ifdef DEBUG
        printf("Log message here...\n");
#endif


слишком медленный sad.gif
rezident
Перепишите (напишите свою) функцию __write или putchar (не помню точно, см. документацию) и перенаправьте вывод куда вам будет угодно.
hash20
Цитата(rezident @ Apr 28 2012, 22:43) *
Перепишите (напишите свою) функцию __write или putchar (не помню точно, см. документацию) и перенаправьте вывод куда вам будет угодно.


Так а каким образом её перенаправить??? (впринципе именно это и интересует) как бы например на компорт перенаправить???
rezident
Цитата(hash20 @ May 3 2012, 12:35) *
Так а каким образом её перенаправить??? (впринципе именно это и интересует) как бы например на компорт перенаправить???

Уважаемый, вы документацию читать умеете? Help->C/C++ Compiler Reference Guide. См. раздел Application debug support, стр.87
Цитата
THE C-SPY TERMINAL I/O WINDOW
To make the Terminal I/O window available, the application must be linked with support
for I/O debugging. This means that when the functions __read or __write are called
to perform I/O operations on the streams stdin, stdout, or stderr, data will be sent
to or read from the C-SPY Terminal I/O window.
Note:The Terminal I/O window is not opened automatically just because __read or
__writeis called; you must open it manually.
For more information about the Terminal I/O window, see the C-SPY® Debugging
Guide for MSP430.

Функции printf и scanf используют stdin и stdout. Замените функцию вывода своей собственной, которая у вас будет класть байт очередного символа не в поток stdout, а в регистр передатчика UART. Вот и все.
hash20
Спасибо...
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2025 Invision Power Services, Inc.