I have STM32F103C8T6 (http://www.kamami.pl/dl/avt1609.pdf) and as programmer I use STM32VLDISCOVERY (STM32F100RB).
I have a problem with USART2 because there Rx seems to be broken it doesn't react on anything. So I wanted to use "demo" for STM32F103 and change USART to 1 or 3 but I have a problem with both. I have tested PA9(USART1_TX) and PB10 (USART3_TX) and there is nothing in there.
Can you tell me what do I have to change except this:
Code: Select all
/*
* SERIAL driver system settings.
*/
#define STM32_SERIAL_USE_USART1 TRUE
#define STM32_SERIAL_USE_USART2 TRUE
#define STM32_SERIAL_USE_USART3 TRUE
#define STM32_SERIAL_USE_UART4 FALSE
#define STM32_SERIAL_USE_UART5 FALSE
#define STM32_SERIAL_USE_USART6 FALSE
#define STM32_SERIAL_USART1_PRIORITY 12
#define STM32_SERIAL_USART2_PRIORITY 12
#define STM32_SERIAL_USART3_PRIORITY 12
#define STM32_SERIAL_UART4_PRIORITY 12
#define STM32_SERIAL_UART5_PRIORITY 12
#define STM32_SERIAL_USART6_PRIORITY 12main.c:
Code: Select all
#include "ch.h"
#include "hal.h"
int main(void) {
halInit();
chSysInit();
sdStart(&SD1, NULL);
sdStart(&SD2, NULL);
sdStart(&SD3, NULL);
sdWrite(&SD1,"ChibiOS/RT Wita na pokladzie!\n\r",32);
sdWrite(&SD2,"ChibiOS/RT Wita na pokladzie!\n\r",32);
sdWrite(&SD3,"ChibiOS/RT Wita na pokladzie!\n\r",32);
while (TRUE) {
sdWrite(&SD1,"SD1\n\r",5);
chThdSleepMilliseconds(50);
sdWrite(&SD2,"SD2\n\r",5);
chThdSleepMilliseconds(50);
sdWrite(&SD3,"SD3\n\r",5);
chThdSleepMilliseconds(500);
}
}
What can be wrong?
Why only USART2 works?