Interrupts from UART3 RX and UART5 RX for STM32F030RC

An area to discuss ARM specific problems and examples

Moderator: Benj

Post Reply
dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

Hello,

I'm a new F7 32-Bit ARM user and just start my first projects on this platform. I choose low cost STM32F030RC chip and got some problem with interrupts. There are two interrupts: UART_RXINT1 and UART_RXINT2, which works well for USART1 and USART2 blocks. I need some help to construct interrupts from UART3 and UART5 receive pins. In attached file I use 3 UART blocks: UART1 (Channel1-USART1, TXpin- PB.6, RXpin- PB.7), UART2 (Channel3-USART3, TXpin- PC.10, RXpin- PC.11) and UART3 (Channel5-USART5, TXpin- PB.3, RXpin- PB.4).
File compiles with error - errors are in my own RXINT3 and RXINT5 interrupts. I tried to construct them like RXINT1 (which is ok). Could you help me to write interrrupts correctly?
Regards, for all Flowcode Users and MATRIX team.
Attachments
STM32_UART_Int.fcfx
(20.6 KiB) Downloaded 230 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by LeighM »

USART 3 to 6 have a shared interrupt USART3_6_IRQn
So things are more complicated.
I'll try and put some time aside to have a look and see if I can add interrupt support for USART 3 to 6 into the FCD for this device.

dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

Thanks so much for quick replay LeighM. I got developed PCB with that configuration: UART1 (RS485 for touch panel), UART3 (RS485 for external building automation) and UART5 (bluetooth module). That will be great to get some solution. Datasheets for ARM are much complex for me (before AVR's was used in my project).

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by LeighM »

Hi,
Could you try the attached.
Drop the 32F030RC.fcdx into your Flowcode installation \FCD\ARM directory and re-load the project.
I've included a modified project that uses the new interrupts, it compiles but I don't currently have a target to test.
Hope it runs :D
Leigh
Attachments
32F030RC.fcdx
(33.8 KiB) Downloaded 224 times
STM32_UART_Int LM.fcfx
(21.6 KiB) Downloaded 236 times

dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

I can't belive... You fix all 6 UART channels :shock: What can I say, you are really a specialist. I can finish my project now.
I will receive my board on friday. I will test it and write here about the results. With that all 6 UARTS, STM32F030RC is a very good chip for everyone
who want to relize low cost advanced projects. I checked all PWM and ADC channels, all works well. Good IC.
F7 for STM32 it's a great tool. Really good job, congratulations for Matrix Staff and big thanks for Leigh.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by LeighM »

Thanks for the update, and yes, please keep us posted with progress with your project :D

dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

Hello,
I promise to write something about modification for STM32F030RC - file from LeighM. I checked interrupt from UART3 RX pin and it works very well. I connect TX to PC.10 and RX to PC.11. Everything works with HC-05 Bluetooth module. I can send and receive data by free BluetoothPro Android application. I add an Bluetooth tested example, maybe it will help someone. Aha, and something else. You can use XM-15 Bluetooth module instead of Bluetooth HC-05. FC7 Bluetooth HC-05 block works with both, but with XM-15 you got good transmissonon on longer distance (HC-05 10m, XM-15 30m in open area). Some bluetooth modules don't accept macros SetName and SetPairKey. You have to change it by USB/UART converter and AT commands. I will check interrupt from UART5 RX soon.
Attachments
Bluetooth_testRC.fcfx
(16.69 KiB) Downloaded 233 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by LeighM »

Thanks for that! :D

dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

Hi,
I tested interrupt from UART5 RX pin for STM32F030RC on friday evening. I need some help with this. I wrote new simple program:
Bluetooth module connected to Channel3-USART3, TXpin- PC.10, RXpin- PC.11;
UART to RS485 converter (VP3082) connected to Channel1-USART1, TXpin- PB.6, RXpin- PB.7, flow control pin PB.5;
UART to RS485 converter (VP3082) connected to Channel5-USART5, TXpin- PB.3, RXpin- PB.4, flow control pin PD.2.
Bluetooth module and converter on USART1 works very well. I can transmit and receive data without any errors (relay switching, receive data from chip).
By USART5 I can only receive data. It looks like not enabled interrupt. I know taht you haven't got board with that chip, but please try to look at that code at free time. Maybe You will find some solution.
Software for RS485 tests: RealTerm Serial Capture Program 1.99.0.27 + USB/RS485 converter
Attachments
UART_testRC.hex
(19.69 KiB) Downloaded 204 times

dionyzoz
Posts: 20
Joined: Mon Jan 29, 2018 5:44 pm
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by dionyzoz »

Sorry for adding HEX file. Here is corect one.
Attachments
UART_testRC.fcfx
(29.81 KiB) Downloaded 240 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupts from UART3 RX and UART5 RX for STM32F030RC

Post by LeighM »

Could you try a 10mS delay after your SendChar loop, and before the setting of the direction pin back to 0?

Post Reply