STM32F1xx - serial terminal not working - needs tips

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
frederic.leuba
Posts: 9
Joined: Wed Oct 03, 2012 9:12 am

STM32F1xx - serial terminal not working - needs tips

Post 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
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F1xx - serial terminal not working - needs tips

Post by mabl »

Have you got a Revision B board?
frederic.leuba
Posts: 9
Joined: Wed Oct 03, 2012 9:12 am

Re: STM32F1xx - serial terminal not working - needs tips

Post by frederic.leuba »

Yes indeed. Any particular issue with that ? Is the code of the demo for revision A ?
Fred
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F1xx - serial terminal not working - needs tips

Post 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.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F1xx - serial terminal not working - needs tips

Post by mabl »

Here are the board files for Rev. B. No promises that they work though...
Attachments
OLIMEX_STM32_P107_REV_B.zip
(3.93 KiB) Downloaded 480 times
frederic.leuba
Posts: 9
Joined: Wed Oct 03, 2012 9:12 am

Re: STM32F1xx - serial terminal not working - needs tips

Post 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.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F1xx - serial terminal not working - needs tips

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F1xx - serial terminal not working - needs tips

Post by Giovanni »

Hi,

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

Giovanni
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F1xx - serial terminal not working - needs tips

Post by mabl »

Hi Giovanni,

I just noticed: Are we missing remapping for USART2 also for Rev. A files? You only enable it for USART3...
frederic.leuba
Posts: 9
Joined: Wed Oct 03, 2012 9:12 am

Re: STM32F1xx - serial terminal not working - needs tips

Post 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
Post Reply