2014-02-23 04:44 AM
Hello,
I want to port uClinux on my STM32F4 Discovery board.I followed this tutorial :and I have successfully(I hope) installed the bootloader and the kernel into the memory.However, I'm now stuck on how to get a terminal and send Linux commands to the board. I have a USB to UART adapter and I have now idea how to do it. is it even possible? given that the tutorial is done using the STM3210E-EVAL board which has a ready USART port.any help would be appreciated2014-02-23 11:19 AM
any idea please?
2014-02-23 01:40 PM
You won't be able to use USART1 on PA9/PA10 on the STM32F4-DISCO.
There is another thread where it was being built for the STM32F429I-DISCO board.2015-01-02 05:03 AM
Hi Hamed,
I am also interested to port uClinux on stm32F4 Discovery board. how you did it...? plz suggest some tutorial for this.... What is current status...? Is it working?2024-03-09 08:35 AM - edited 2024-03-09 08:40 AM
This is an old thread but I'll reply to it anyway, in case someone else runs into this problem.
"However, I'm now stuck on how to get a terminal and send Linux commands to the board. I have a USB to UART adapter and I have now idea how to do it. is it even possible?"
Linux will use printf() (actually fprintf) to communicate with a terminal. Printf() in turn relies on _write() to output a string to the terminal. You'll have to implement a _write() function which in turn printf() will call. Such code will look something like this:
int __io_putchar(int ch)
{
/* Support printf over UART */
(void) HAL_UART_Transmit(&UartHandle, (uint8_t *) &ch, 1, 0xFFFFU);
return ch;
}
int _write(int file, char *ptr, int len)
{
/* Send chars over UART */
for (int i = 0; i < len; i++)
{
(void) __io_putchar(*ptr++);
}
return len;
}
Of course you will have to set up a UART to do this.
Also, if you aren't using an OS you can include stdio.h in your code and write these functions you can then use printf() in your code, which will send output to the UART, which you can connect to a terminal. This is very handy for debugging.