but the interrupt does not work(i set a breakpoint in the ISR but never reach there)
everything works well when i use RT OSAL..
ChibiOS_3.0.5(in fact i had tried the latest version 16.1.4)
arm-none-eabi-gcc 5.2.1 20151202
i try to fit the example "testhal/STM32/STM32F1xx/UART" to bare-metal like this..
it only print out a line: "Starting..."
Code: Select all
#include "hal.h"
static void txend2(UARTDriver *uartp) {
(void)uartp;
osalSysLockFromISR();
uartStartSendI(&UARTD2, 12, "Running...\r\n");
osalSysUnlockFromISR();
}
static UARTConfig uart_cfg_1 = {
NULL,
txend2,
NULL,
NULL,
NULL,
38400,
0,
USART_CR2_LINEN,
0
};
int main(void) {
halInit();
// chSysInit();
uartStart(&UARTD2, &uart_cfg_1);
uartStartSend(&UARTD2, 13, "Starting...\r\n");
while (true) {
osalThreadSleepMilliseconds(500);
}
return 0;
}
makefile
Code: Select all
# Startup files.
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_P103/board.mk
#include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/hal/osal/os-less/ARMCMx/osal.mk
# RTOS files (optional).
#include $(CHIBIOS)/os/rt/rt.mk
#include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk