Page 1 of 1

STM32F746-NUCLEO slow IO

Posted: Mon Aug 07, 2017 6:04 am
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?

Re: STM32F746-NUCLEO slow IO

Posted: Mon Aug 07, 2017 8:52 am
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 8777 times
Hope that helps.
Leigh

Re: STM32F746-NUCLEO slow IO

Posted: Mon Aug 07, 2017 5:29 pm
by STibor
Hello!

Thanks, this works.
9MHz IO frequency.

The total port write is only 206-209kHz.

Re: STM32F746-NUCLEO slow IO

Posted: Mon Aug 21, 2017 6:11 pm
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?

Re: STM32F746-NUCLEO slow IO

Posted: Mon Aug 21, 2017 7:20 pm
by LeighM
I will investigate and get back to you

Re: STM32F746-NUCLEO slow IO

Posted: Tue Aug 22, 2017 4:07 pm
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.

Re: STM32F746-NUCLEO slow IO

Posted: Tue Aug 22, 2017 4:31 pm
by LeighM
Please try this (drop it into .. Flowcode7\CAL\STARM)

Re: STM32F746-NUCLEO slow IO

Posted: Wed Aug 23, 2017 8:57 pm
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?

Re: STM32F746-NUCLEO slow IO

Posted: Thu Aug 24, 2017 1:38 pm
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

Re: STM32F746-NUCLEO slow IO

Posted: Fri Aug 25, 2017 11:01 am
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 8589 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