Page 1 of 2

STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 9:43 am
by frederic.leuba
Hello,
I'm working with the ARMCM3-STM32F107-FATFS demo, on the Olimex STM32-P107 board.
I'm supposed to have an interactive terminal on the COM1 port, that is mapped to USART2.
I have nothing!!! and I cannot find why.

I connect to the board with

Code: Select all

screen /dev/tty.USB1 38400

Nothing happens, the screen keeps blank.

Could anyone give me some clues where to search, and some advices to identify the problem and solve it ?

Thanks,
Fred

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 9:45 am
by mabl
Have you got a Revision B board?

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 9:54 am
by frederic.leuba
Yes indeed. Any particular issue with that ? Is the code of the demo for revision A ?
Fred

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 9:57 am
by mabl
Indeed. Revision A has different serial Port mappings and Ethernet MAC than Rev. B.

@giovanni: We should really include Rev. B Board definitions. I had a PM already this morning with equal problems. Also, I think I have Rev. B board files flying around. I'll check and post them here.

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 10:05 am
by mabl
Here are the board files for Rev. B. No promises that they work though...

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 10:06 am
by frederic.leuba
@mabl: Prima :-) I hope it will fix our problem. This will also help us understand a bit more how the mapping works.
@giovanni: yes, we should include Rev.B board definition. By the way, thanks for your great work. We are new here, we'll contrite as much as we can.

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 10:11 am
by mabl
@frederic.leuba
Also remember to fix your used serial port in the main.c file. In Rev. B you should use SD2, not SD3.

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 10:21 am
by Giovanni
Hi,

After Frederic confirms I will include the files to the distribution, my fault for not doing this already...

Giovanni

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 10:45 am
by mabl
Hi Giovanni,

I just noticed: Are we missing remapping for USART2 also for Rev. A files? You only enable it for USART3...

Re: STM32F1xx - serial terminal not working - needs tips

Posted: Wed Oct 03, 2012 11:25 am
by frederic.leuba
Bad news, after recompiling with Rev.B board files, it still does not work.
Something sounds suspicious to me :

Code: Select all

/*
 * Port D setup:
 * PD0  - Input with PU     (unconnected).
 * PD1  - Input with PU     (unconnected).
 * PD2  - Input with PU     (unconnected).
 * PD3  - Input with PU     (unconnected).
 * PD4  - Input with PU     (unconnected).
 * PD5  - Alternate output  (USART2 TX, UEXT).
 * PD6  - Input with PU     (USART2 RX, UEXT).
 * PD7  - Push Pull output  (USB_VBUSON).
 * PD8  - Alternate output  (USART2 TX, remapped).
 * PD9  - Normal input      (USART2 RX, remapped).
 * PD10 - Input with PU     (unconnected).
 * PD11 - Normal input      (USART2 CTS, remapped).
 * PD12 - Alternate output  (USART2 RTS, remapped).
 * PD13 - Input with PU     (unconnected).
 * PD14 - Input with PU     (unconnected).
 * PD15 - Input with PU     (unconnected).
 */
#define VAL_GPIODCRL            0x38B88888      /*  PD7...PD0 */
#define VAL_GPIODCRH            0x888B484B      /* PD15...PD8 */
#define VAL_GPIODODR            0xFFFFFFFF


In the comments, it says that USART2 is also mapped to PD8 and PD9... It should be USART3, no ?
I know it is only a comment, but maybe there is also something wrong in the define bellow.
Actually, I still don't understand how this mapping declarations work... I hope I'll get used to it soon.

Hopefully someone (maybe mabl) can help me go further. Thanks.

Fred