cancel
Showing results for 
Search instead for 
Did you mean: 

UClinux on STM32F4 Discovery

amine
Associate II
Posted on February 23, 2014 at 13:44

Hello,

I want to port uClinux on my STM32F4 Discovery board.

I followed this tutorial :

http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/application_note/CD00242717.pdf

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 appreciated
4 REPLIES 4
amine
Associate II
Posted on February 23, 2014 at 20:19

any idea please?

Posted on February 23, 2014 at 22:40

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.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
atiq_36
Associate
Posted on January 02, 2015 at 14:03

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?

Someguy
Associate III

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.