cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-F207ZG UART issue

SDu T
Associate III

Good day

I am not sure what I am doing wrong as I was quite successful on other dev kits to import examples.

I have downloaded en.stm32cubef2-v1-9-4 from the ST website and I am trying to import some of the examples from th eProjects->NUCLEO-F207ZG->Examples and Examples_LL and Examples_MIX.

I am using STM32CubeIde V1.14.1 and none of the examples want to import.

I am currently trying to get the Uarr to trigger the interrupt when a character is received. I can even measure the character I send using a scope, but the interrupt does not trigger. I can send a cahracter and that triggers the Interrupt

 

I hope someone can help.

8 REPLIES 8
KDJEM.1
ST Employee

Hello @SDu T ,

none of the examples want to import.

Could you please give more details about the issue.

What examples of projects have you encountered this problem?

Do you get an error ?

I recommend you to follow the steps in Migration guide from System Workbench to STM32CubeIDE

This document is a brief guide explaining how to import projects from System Workbench for STM32 (SW4STM32) to STM32CubeIDE.

I hope this help you.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi

 

The Document you referred to did not help, but In the directory of the project I want to import

I have multiple sub-directories. When I import do I select the whole folder called UART_Hyperterminal_IT or do I select the sub-folderSW4STM32?

When I import, it does not as if I want to convert the files.

When I compile I get 8 errors

 

Description Resource Path Location Type
fatal error: stm32f2xx_hal.h: No such file or directory main.h /UART_HyperTerminal_IT/Inc line 24 C/C++ Problem
make: *** [Example/User/subdir.mk:25: Example/User/main.o] Error 1 STM32F207ZG-Nucleo C/C++ Problem
make: *** [Example/User/subdir.mk:27: Example/User/stm32f2xx_hal_msp.o] Error 1 STM32F207ZG-Nucleo C/C++ Problem
make: *** [Example/User/subdir.mk:29: Example/User/stm32f2xx_it.o] Error 1 STM32F207ZG-Nucleo C/C++ Problem
make: *** No rule to make target 'C:/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c', needed by 'Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal.o'. Stop. STM32F207ZG-Nucleo C/C++ Problem
make: *** Waiting for unfinished jobs.... STM32F207ZG-Nucleo C/C++ Problem
Invalid project path: Include path not found (C:\Drivers\BSP\STM32F2xx_Nucleo_144). STM32F207ZG-Nucleo pathentry Path Entry Problem
Invalid project path: Include path not found (C:\Drivers\CMSIS\Device\ST\STM32F2xx\Include). STM32F207ZG-Nucleo pathentry Path Entry Problem
Invalid project path: Include path not found (C:\Drivers\CMSIS\Include). STM32F207ZG-Nucleo pathentry Path Entry Problem
Invalid project path: Include path not found (C:\Drivers\STM32F2xx_HAL_Driver\Inc). STM32F207ZG-Nucleo pathentry Path Entry Problem
Project 'STM32F207ZG-Nucleo' has no explicit encoding set STM32F207ZG-Nucleo /STM32F207ZG-Nucleo No explicit project encoding
Project 'SW4STM32' has no explicit encoding set SW4STM32 /SW4STM32 No explicit project encoding
Project 'UART_HyperTerminal_IT' has no explicit encoding set UART_HyperTerminal_IT /UART_HyperTerminal_IT No explicit project encoding

SDu T
Associate III

Hi

Maybe we could just skip the import and you help me figure out why I do not get an interrupt on receiving a character on the uart

Pavel A.
Evangelist III

@SDu T IMHO no, the project must build correctly first, otherwise there's no use in discussing why it does not work.

To build correctly, the project must be either imported correctly or built with the original toolchain/IDE it was created for (Keil or IAR).  Have you used the CubeIDE "Import example" tool to import your project?

KDJEM.1
ST Employee

Hello @SDu T ,

For the import project issue. I made some tests and I can't reproduce the issue.

For that, could you please try to download the STM32CubeF2 from this link

KDJEM1_0-1706892130810.png

Then, to import the project in STM32CubeIDE1.14.0 version, I recommend you to follow these steps:

1- Open STM32CubeIDE1.14.0 version

2- Click File-->Open Projects from File System as shown in the below figure

KDJEM1_1-1706892770008.png

 

3- Browse the Demonstrations\STM32CubeIDE project file located in this path "\STM32Cube_FW_F2_V1.9.4\Projects\NUCLEO-F207ZG\Examples_MIX\UART\UART_HyperTerminal_IT\SW4STM32\STM32F207ZG-Nucleo" as shown in the below figure

KDJEM1_2-1706892902249.png

4-Click on OK to import convert the project

KDJEM1_3-1706893071673.png

KDJEM1_4-1706893128900.png

5- Build the project

For the interrupt issue, please make sure that you are activated the USART global interrupt.

Also could you please check the priority of this interrupt.

If you using the STM32CubeIDE, I think this wiki Getting started with UART - stm32mcu may you.

Thanks and best regards,

Kaouthar

 

 

 

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi all

 

The Getting started with UART - stm32mcu document did help.

I still have one question.

Before I call this function:

UART_Start_Receive_IT(&huart1, Rx1_Buffer, 1);

The uart does not trigger on any incoming characters. After calling this, the uart seem to work properly.

 

these 2 functions are called during the Uart init. Looks like there is still something I miss

 

HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);

HAL_NVIC_EnableIRQ(USART1_IRQn)

Pavel A.
Evangelist III

Before I call this function:

>UART_Start_Receive_IT(&huart1, Rx1_Buffer, 1);

>The uart does not trigger on any incoming characters. 

Yes, because the RX interrupt gets enabled only inside this function. Because of this, UART_Receive_IT is almost useless, especially when called to receive one byte (and naive folks copy & paste this stupidity all the time). Unfortunately the only HAL library function that is practically usable is UART_Receive_DMA in continuous cyclic mode. Or roll your own receive function with interrupts.

I will give the DMA a try