Hi,
I'm trying to implement:
1. printf() functions over UART
2. Shell over UART.
First, I have the UART2 enabled by setting:
HAL_USE_UART in halconf.h
UART_USE_WAIT in halconf.h
STM32_UART_USE_USART2 in mcuconf.h
so far so good, and I can successfully transmit and receive bytes with the uartSendXXX() and uartReceiveXXX() functions.
Now I'm trying to move toward using shell, so I have the serial driver enabled:
HAL_USE_SERIAL in halconf.h
but now I have the error:
../src/hal_uart_lld.c:349: multiple definition of `VectorD8'
../src/hal_serial_lld.c:322: first defined here
What do I wrong?
Serial and Shell over UART how?
-
- Posts: 35
- Joined: Fri Feb 09, 2018 12:44 am
- Has thanked: 2 times
- Been thanked: 5 times
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Serial and Shell over UART how?
Hi,
The serial driver is alternative to the UART driver, you just need the serial driver for this. There are several examples of shell over serial in demos and testhal that you could use as template.
Giovanni
The serial driver is alternative to the UART driver, you just need the serial driver for this. There are several examples of shell over serial in demos and testhal that you could use as template.
Giovanni
-
- Posts: 35
- Joined: Fri Feb 09, 2018 12:44 am
- Has thanked: 2 times
- Been thanked: 5 times
Re: Serial and Shell over UART how?
Thanks, Giovanni,
now I have managed to get the shell over serial compiled and running. But the data sent and receiver is invalid: I see two bytes received when I send just one. For example, if I send 0x61 (press 'a' in the screen program), I always receive the 0x78 and 0xf8 bytes, and so on.
If I use the UART driver, I do not experience such a problem.
I build with the ChibiOS 17.6.3. I noticed, the code to initialize the UART registers differ in the UART and SD drivers
now I have managed to get the shell over serial compiled and running. But the data sent and receiver is invalid: I see two bytes received when I send just one. For example, if I send 0x61 (press 'a' in the screen program), I always receive the 0x78 and 0xf8 bytes, and so on.
If I use the UART driver, I do not experience such a problem.
I build with the ChibiOS 17.6.3. I noticed, the code to initialize the UART registers differ in the UART and SD drivers
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Serial and Shell over UART how?
It is a configuration mismatch probably, try the default configuration (NULL in sdStart) that is always 38400-8-N-1.
Giovanni
Giovanni
-
- Posts: 35
- Joined: Fri Feb 09, 2018 12:44 am
- Has thanked: 2 times
- Been thanked: 5 times
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Who is online
Users browsing this forum: No registered users and 2 guests