Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 19, 2024, 06:45:24 06:45


Login with username, password and session length


Pages: 1 2 [3]  All
Print
Author Topic: Playing with STM32CubeMX  (Read 52328 times)
0 Members and 2 Guests are viewing this topic.
Espark
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 5
-Receive: 2


« Reply #50 on: December 09, 2015, 10:58:04 10:58 »

It appears that : when an interrupt occur the system does to: IRQ_Handler
inside this function you can either write your own routine and clear interrupt flag using macro
or let HAL service the interrupt by HAL_UART_IRQHandler. and write your routine after that or in a call back function .

still donot know which is better practice , and wether using the HAL handler is consuming too much CPU cycles

Logged
TucoRamirez
Senior Member
****
Offline Offline

Posts: 307

Thank You
-Given: 257
-Receive: 115


Tuco ... dead or Alive


« Reply #51 on: December 09, 2015, 06:41:14 18:41 »

dunno, i'm a barebone guy and i use the IRQ_Handlers on IAR with the startup.s corresponding file...    i'll get into HAL this holidays ...  i think ...   
Logged

Whoever double crosses me and leaves me alive... he understands nothing about Tuco.
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #52 on: December 10, 2015, 03:53:12 15:53 »

if someone worked with USART using interrupts , can u tell me how to specify the source of interrupt ( tx or rx or error ) , because in cubemx you just set a global interrupt enable. ( i guess i have to use the macro : __USART_ENABLE_IT() , but i donot know when or where )

and how is the HAL_USART_RECIEVE_IT() used ? should it be called once ??

where is the interrupt service routine ( something similar to __void interrupt handler () in PIC ) or is this the same as call back function

STM32CubeMX is only an initialization code generator, after that what we need is to open the HAL library reference manual (UM1725 for F4).

For every interrupt function enabled, CubeMX will generate IRQ_Handler on stm32Xxx_it.c file. Right click the function called inside the handler and select "go to definition of..", it will open corresponding HAL driver file - here we will need to read the reference manual.

We need to write our own code for HAL_UART_RxCpltCallback and HAL_UART_TxCpltCallback to handle the data on interrupt RX/TX, those function define as empty weak function on HAL library which will be overwritten by user code. See the UART samples on the repository project sample.

One annoying thing with HAL USART library is we need to know the data length both for RX and TX, most of the the receive function has no info how is the length of the data will be received but use termination character as end of data signal. On this case USART with DMA is the way out, google has some info about this.

-ichan
Logged

There is Gray, not only Black or White.
Espark
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 5
-Receive: 2


« Reply #53 on: December 14, 2015, 09:47:27 09:47 »

thank you chan for your reply . I will clarify how i am working now for others to benefit or comment,
 i just didnot find the HAL_XXX_IRQHandlers to suit my taste , so what i am doing now is commenting this line and writing my own routine or function inside USART1_IRQHandler , the most important thing to remember is to clear the corresponding bit using macro :__HAL_UART_CLEAR_FLAG(&huart1,UART_FLAG_RXNE) . Since i have disabled all the other interrupts of usart (like txe ,tc ,pe , ne ,ore ....) hal handler go check for each of these and clear them then it call another function called receive or transmit then it calls a call back function , because it is a very generic function. what  a waste of CPU power !!!!!
I also find the interrupt method inconvenient because if i have a 20 char message send every 100ms , contain header , address checksum ....
if i ask the HAL_Receive_IT to get 20chars for me , maybe the header is not the first among them , then i will get incomplete message , so i have to read again ...etc
instead on each character received i interrupt save this character in a 255 size array , and later i access this array to search for header , and other message parameters ( basically i created something like the arduino serial library ) Roll Eyes)))
« Last Edit: December 14, 2015, 09:50:27 09:50 by Espark » Logged
neodimio91
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 10
-Receive: 1


« Reply #54 on: January 21, 2016, 03:30:38 15:30 »

Hey guys I'm new on the forum ! I hope I'm not OT here, years ago I developed some libraries and examples using my stm32 discovery with stm32f100RB on board ( if someone interested I ported some libraries or fixed to work on the discovery for example chips like MPU6050,MS5611,HMC5883L,nRF24L01P,ST7735).
 I'm approching with the new MDK of keil on the uVision5 ,I opened the old project from uVision 4 but trying to convert it (not the legacy import) .I experienced problems building the project ( it worked great with uVision 4).
I ran manage run time inviroment suggested from here  www.keil.com/forum/24398/ and add device and peripherals I'm using on the project ,but errors increase bulding the project :C e.g ..the first is "no source": Error:  #5: cannot open source input file "..\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c": No such file or directory
Anyone can help me a little ?
thanks
P.S no problem at all with the legacy import
« Last Edit: January 21, 2016, 04:24:44 16:24 by neodimio91 » Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #55 on: January 21, 2016, 07:55:37 19:55 »

you need to see where the missing files are, and check if you are using the correct library version. Also, you might need to install the the legacy support pack in case you have not installed it yet.
Logged
neodimio91
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 10
-Receive: 1


« Reply #56 on: January 22, 2016, 12:40:27 00:40 »

you need to see where the missing files are, and check if you are using the correct library version. Also, you might need to install the the legacy support pack in case you have not installed it yet.
Yeah with the legacy library everything works, my intent was only to undestand if someone has experienced a import to the new MDK ,I'll try a new project with the new one so maybe I'll find a solution about the system_stm32f10x.c that compiler isn't able to find !
Logged
h0nk
Senior Member
****
Offline Offline

Posts: 255

Thank You
-Given: 206
-Receive: 229



« Reply #57 on: January 22, 2016, 11:09:20 11:09 »


Hello neodimio91,

You have installed the ST "STM32F10x_StdPeriph_Lib_VX.Y.0" somewhere.
The file "system_stm32f10x.c" You will find at the directory:
"\$INSTALLDIR\stm32f10x_stdperiph_lib\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\"

This file is also included in the software pack: "Keil.STM32F1xx_DFP.2.0.0.pack"
You should try to install the pack and configure Your project to use it.


Best Regards
Logged
neodimio91
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 10
-Receive: 1


« Reply #58 on: January 22, 2016, 09:23:46 21:23 »

Hello neodimio91,

You have installed the ST "STM32F10x_StdPeriph_Lib_VX.Y.0" somewhere.
The file "system_stm32f10x.c" You will find at the directory:
"\$INSTALLDIR\stm32f10x_stdperiph_lib\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\"

This file is also included in the software pack: "Keil.STM32F1xx_DFP.2.0.0.pack"
You should try to install the pack and configure Your project to use it.


Best Regards


Thanks! Tomorrow I 'll give a try and I'll post the result, I think that something goes wrong during installation cuz in legacy mode everything goes right ,debug mode too!
Logged
metyusan
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 13
-Receive: 3


« Reply #59 on: February 03, 2016, 10:02:43 10:02 »

Hi,

I am working with the EMWIN on stm32f429-discovery board. Demo code examples work for portrait mode. I could not perform the landscape layout for both GUI windows and touchpad.

Does anybody who does this?

Thanks for reply..
Logged
neodimio91
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 10
-Receive: 1


« Reply #60 on: March 02, 2016, 04:51:22 16:51 »

Hi,

I am working with the EMWIN on stm32f429-discovery board. Demo code examples work for portrait mode. I could not perform the landscape layout for both GUI windows and touchpad.

Does anybody who does this?

Thanks for reply..

Hi,
Do you try to compile and load to the dev board from a different IDE( or older ide version)? Maybe you have some wrong settings, maybe with a old version IDE the problem disappear ,so from it, you can debug and find where is the problem.
I had a similar problem, maybe you are compiling with a IDE not native for your demo project ,check it out!
But wait ,are you sure that your code has this feauture? maybe is not implemented yet
Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #61 on: March 02, 2016, 04:57:54 16:57 »

STM32 ST-LINK Utility requires you reloading the file after each successful compile. it doesn't take the latest version of the file automatically.
Logged
avrlover
Active Member
***
Offline Offline

Posts: 114

Thank You
-Given: 50
-Receive: 215


« Reply #62 on: November 09, 2016, 03:49:48 03:49 »

very good presentation on stm32cube links are at bottom
https://blog.brichacek.net/stm32f4-discovery-kit-pro-stm32f429/


https://blog.brichacek.net/wp-content/uploads/2015/10/STM32Cube-Presentation.pdf
https://blog.brichacek.net/wp-content/uploads/2015/10/STM32F4-and-FreeRTOS.pdf
https://blog.brichacek.net/wp-content/uploads/2015/10/STM32F4-Labs.pdf
https://blog.brichacek.net/wp-content/uploads/2015/10/STM32F4-and-USB.pdf



Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #63 on: March 10, 2017, 09:47:08 09:47 »

any one succeeded using cubeMX with uncleo-429Z for at least a ping :S
Logged
Pages: 1 2 [3]  All
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC