Skip to content
pmaionePublic

About

Logger module for embedded systems

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Logger (Para microcontroladores)

Biblioteca de funções logger

Instruções

Adicionar flag no inicio do Makefile:

# Log Level [0~5]
LOG_LEVEL ?= 0

Na Seção #C defines inserir:

C_DEFS += -DLOG_LEVEL=$(LOG_LEVEL)

Adicionar o parâmetro ao make:

make LOG_LEVEL=5 <recipes>

Inserir a função de inicialização do Módulo Logger após a configurar o periferico USART utilizado:

/* Inicializa modulo Logger para debug via serial (LL Driver)*/
  Log_Init(USART1, LOG_LEVEL, millis);

Examples

Log_Init();

Util

Setup do printf para STM32F1

Adicionar flag no Makefile:

CFLAGS += -specs=nano.specs
CFLAGS += -specs=nosys.specs

Adicionar o trecho de código abaixo:

/**
 * @brief  Retargets the C library printf function to the USART.
 * @param  None
 * @retval None
 */
#ifdef __GNUC__
int __io_putchar(int ch)
#else
int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
{
  /* Send ch trough desired peripheral */
  if (ch == '\n') {
  }
  /* Rotina para envio de caractere pela serial */
  Usart_Send_Char(PRINTF_USART_INSTANCE, ch);

  return ch;
}

About

Logger module for embedded systems

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages