STM32F746-NUCLEO slow IO

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

STM32F746-NUCLEO slow IO

Post by STibor »

Hy,

I tested the new ARM core pcb.
Very slow IO speed.
Nucleo - 635.8 kHz
Arduino nano-1.6MHz
What's the problem?
Why is faster an 8bit 16MHz controller than a 32bit 200MHz controller?
Attachments
arduino vs arm.jpg
arduino vs arm.jpg (95.9 KiB) Viewed 7779 times
arduino_nano_IO_test_1.fcfx
(7.84 KiB) Downloaded 204 times
stm32f746zg_IO_test_1.fcfx
(7.94 KiB) Downloaded 214 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: STM32F746-NUCLEO slow IO

Post by LeighM »

Hi,
This is due to our use of the ST HAL libraries, which add flexibility, but lose efficiency.
In view of this we did change the bit setting to not use HAL, but direct access code instead.
However it looks like the Output Icon is using the port mask setting code, I will need to investigate why that is the case.

In the meantime you could force the use of bit setting code, which is faster, by accessing the pin via a property...
mypin.jpg
mypin.jpg (56.7 KiB) Viewed 7771 times
Hope that helps.
Leigh

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F746-NUCLEO slow IO

Post by STibor »

Hello!

Thanks, this works.
9MHz IO frequency.

The total port write is only 206-209kHz.
Attachments
stm32f746zg_full_port_test_1.fcfx
(8.14 KiB) Downloaded 200 times

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F746-NUCLEO slow IO

Post by STibor »

STibor wrote:Hello!
The total port write is only 206-209kHz.
Hello!

Do you have a solution to increase port and full port speed?

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: STM32F746-NUCLEO slow IO

Post by LeighM »

I will investigate and get back to you

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: STM32F746-NUCLEO slow IO

Post by LeighM »

Hi,
Have you any particular scenario that you want to improve?
The time to write to port could be improved, but the main issue is the time to setup the port configuration, such as data direction etc.
To simplify use for most users we do the setup as part of the output icon functionality.
If you use an icon to set the port into output mode, the fastest way to then write to the port would be a C icon..

Code: Select all

PORTA->ODR = x;
That would not simulate, but would it be the best answer for your intended use?
If not, I'll continue seeing what I can tweak out of the code.

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: STM32F746-NUCLEO slow IO

Post by LeighM »

Please try this (drop it into .. Flowcode7\CAL\STARM)
Attachments
STARM_CAL_IO.h
(4.84 KiB) Downloaded 211 times

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F746-NUCLEO slow IO

Post by STibor »

LeighM wrote:Please try this (drop it into .. Flowcode7\CAL\STARM)
Thanks for your help!
Using the modified file, the 8-bit output is about three times faster.

Can not write direct port for 16 bit output? Do you need bit shift operations?

I would like to use a graphical display (SSD1289 or higher resolution LCD).
I'm afraid it will be slow.
Fast microcontroller, the IO operation slows down.

What is the FPS value of the STM32F746 Discovery's GLCD display?
Do you use the internal LCD driver of your ARM or have a software drive?

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: STM32F746-NUCLEO slow IO

Post by LeighM »

Thanks for your help!
Using the modified file, the 8-bit output is about three times faster.
Thanks for the feedback
Can not write direct port for 16 bit output? Do you need bit shift operations?
Flowcode treats 16 bit ports as a high and low 8 bit port.
I would like to use a graphical display (SSD1289 or higher resolution LCD).
I'm afraid it will be slow.
Fast microcontroller, the IO operation slows down.
You could write a full 16 bit port using a C icon or calculation icon referencing the $PORT variable.
What is the FPS value of the STM32F746 Discovery's GLCD display?
Don't know, I would have to look that up in the ST docs
Do you use the internal LCD driver of your ARM or have a software drive?
Both, the gLCD component draws the font glyphs, such that our gLCD displays are similar.
We use the ST BSP LCD drivers to plot the points

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: STM32F746-NUCLEO slow IO

Post by LeighM »

Can not write direct port for 16 bit output? Do you need bit shift operations?
Ben has just shown me a full 16 bit port feature in Flowcode, here is how to do it ...
full_port.jpg
full_port.jpg (47.93 KiB) Viewed 7583 times
So I've also optimized the CAL to support a fast write for this, updated CAL attached.
I intend to give all the ST IO (.h and .c) files similar improvement, at some point :)

Hope it helps,
Leigh
Attachments
STARM_CAL_IO.h
(4.98 KiB) Downloaded 195 times

Post Reply