STM32L072 and uart number...
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
STM32L072 and uart number...
Hi all
Here , just a question: is it possible to use USART4 (or 5) with interrupts ? (for UART number 1 or 2, I use "IVT_INT_USART1" but I can't see any possibility to use other port number).
I'm using STM32L072 and would like to use serial ports 1,2,4,5
Thanks for solutions
Here , just a question: is it possible to use USART4 (or 5) with interrupts ? (for UART number 1 or 2, I use "IVT_INT_USART1" but I can't see any possibility to use other port number).
I'm using STM32L072 and would like to use serial ports 1,2,4,5
Thanks for solutions
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: STM32L072 and uart number...
Hi,
According to the STM32L0x2 family reference manual, page 280, you can find USART4/USART5 interrupt under the name IVT_INT_RESERVED6.
Kind regards,
According to the STM32L0x2 family reference manual, page 280, you can find USART4/USART5 interrupt under the name IVT_INT_RESERVED6.
Kind regards,
Stefan Filipović
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
Re: STM32L072 and uart number...
Hi
Thanks a lot for your answer
I already tried IVT_INT_RESERVED6 (or decimal 30) but it doesn't works.
I was wondering about term "reserved", that's why I was afraid about STM32L072 interrupt possibility for uart4/5 . If it's a problem, I will use a STM32L151 instead.
Can you help me ?
Interrupt
For interrupt configuration:
Update: I found a problem ... on the other board witch provide UART signal...
Thanks a lot for your answer
I already tried IVT_INT_RESERVED6 (or decimal 30) but it doesn't works.
I was wondering about term "reserved", that's why I was afraid about STM32L072 interrupt possibility for uart4/5 . If it's a problem, I will use a STM32L151 instead.
Can you help me ?
Interrupt
void IntRxTx4() iv 30 ics ICS_AUTO //(or IVT_INT_RESERVED6)
{
Rx4_Ready=1; //never happen
...
}
For interrupt configuration:
NVIC_IntEnable(30);
Update: I found a problem ... on the other board witch provide UART signal...
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: STM32L072 and uart number...
Hi,
I'm glad that you have managed to solve this.
Kind regards,
I'm glad that you have managed to solve this.
Kind regards,
Stefan Filipović
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
Re: STM32L072 and uart number...
OK. Some news:
I decided to try using serial port1,2,4,5 to compare results
For better understanding, I removed serial port interrupt and just use this
And, also, I first removed other board serial transmiter
For serial ports 1,2,5 there is no "received" message
But for serial port 4 , even if no serial board connected, message "Received" appear and data value is "0".
So I still have a problem with serial port 4
Question(solution ?): to use serial port 4, did I have to specify PC10, PC11 ?
Update: I wrote but it doesn't change anything
I decided to try using serial port1,2,4,5 to compare results
Code: Select all
uart1_init(9600);
uart2_init(9600);
uart4_init(9600);
uart5_init(9600);
For better understanding, I removed serial port interrupt and just use this
Code: Select all
while(1)
{
...
if (UART4_Data_Ready()) // or other number port
{
x1=uart4_read(); // or other number port
bytetostr(x1,Text1);
Led_Action(1,1,1,5); // just a visual control using timer interrupt
SSD1306_WriteText(0,1,"Received",0,0);
SSD1306_WriteText(0,2,Text1,0,0);
delay_ms(2000);
SSD1306_WriteText(0,1," ",0,0);
}
}
And, also, I first removed other board serial transmiter
For serial ports 1,2,5 there is no "received" message
But for serial port 4 , even if no serial board connected, message "Received" appear and data value is "0".
So I still have a problem with serial port 4
Question(solution ?): to use serial port 4, did I have to specify PC10, PC11 ?
Update: I wrote
Code: Select all
UART4_Init_Advanced(9600, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART4_PC10_11);
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: STM32L072 and uart number...
Hi,
Are you sure that you did set configuration bits in the Edit Project window properly?
I've just tested all four USART modules on STM32L072VZ and I have not reproduced any issue.
Would you like to zip and attach your project here for inspection?
Kind regards,
Are you sure that you did set configuration bits in the Edit Project window properly?
I've just tested all four USART modules on STM32L072VZ and I have not reproduced any issue.
Would you like to zip and attach your project here for inspection?
Kind regards,
Stefan Filipović
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
Re: STM32L072 and uart number...
I sent you complete file. Any suggestion ?
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
Re: STM32L072 and uart number...
Sorry
I can't see anything new on my messages (last message august 22)
I can't see anything new on my messages (last message august 22)
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: STM32L072 and uart number...
Hi,
I did respond you by an email, not a forum message.
Did you get my email? I will send it once again.
Kind regards,
I did respond you by an email, not a forum message.
Did you get my email? I will send it once again.
Kind regards,
Stefan Filipović
-
- Posts: 240
- Joined: 16 Jan 2010 22:26
Re: STM32L072 and uart number...
Sorry, I didn't look at thi smail box.
Now I can see your answer.
I will do some tests with my analyser and, also, I'm making a new PCB board.
Thanks & regards
Now I can see your answer.
I will do some tests with my analyser and, also, I'm making a new PCB board.
Thanks & regards
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
-
- Posts: 6
- Joined: 11 Apr 2021 16:39
Re: STM32L072 and uart number...
Hello
Sorry to re-open this tread, but I have issue with USART1 on STM32L072
Usart Init compile OK, but if I try to edit register, it said undeclared identifier.
Same register work OK with USART2
Examples:
UE_USART2_CR1_bit = 1;
RE_USART2_CR1_bit = 1; //receiver enable
RXNEIE_USART2_CR1_bit = 1; //rx on
TXEIE_USART2_CR1_bit = 0;
Ok with USART2, but:
UE_USART1_CR1_bit = 1;
RE_USART1_CR1_bit = 1; //receiver enable
RXNEIE_USART1_CR1_bit = 1; //rx on
TXEIE_USART1_CR1_bit = 0;
give Undeclared identifier
Checking STM32L072RZ.c with "ctrl+alt+d" at line 17276, it is there...
USART initialization:
UART1_Init_Advanced(SER1, _UART_8_BIT_DATA, _UART_EVENPARITY, _UART_TWO_STOPBITS, &_GPIO_MODULE_USART1_PA9_10);
UART2_Init(115200);
Look like a bug to me, I'm right?
Thanks
Fred
Sorry to re-open this tread, but I have issue with USART1 on STM32L072
Usart Init compile OK, but if I try to edit register, it said undeclared identifier.
Same register work OK with USART2
Examples:
UE_USART2_CR1_bit = 1;
RE_USART2_CR1_bit = 1; //receiver enable
RXNEIE_USART2_CR1_bit = 1; //rx on
TXEIE_USART2_CR1_bit = 0;
Ok with USART2, but:
UE_USART1_CR1_bit = 1;
RE_USART1_CR1_bit = 1; //receiver enable
RXNEIE_USART1_CR1_bit = 1; //rx on
TXEIE_USART1_CR1_bit = 0;
give Undeclared identifier
Checking STM32L072RZ.c with "ctrl+alt+d" at line 17276, it is there...
USART initialization:
UART1_Init_Advanced(SER1, _UART_8_BIT_DATA, _UART_EVENPARITY, _UART_TWO_STOPBITS, &_GPIO_MODULE_USART1_PA9_10);
UART2_Init(115200);
Look like a bug to me, I'm right?
Thanks
Fred
Re: STM32L072 and uart number...
Hi,
Try using this :
Regards.
Filip.
Try using this :
Code: Select all
UE_bit = 1
RE_bit = 1
RXNEIE_bit = 1
TXEIE_bit = 0
Filip.