[STM32GENERIC] Latest - issues

Discussions about the STM32generic core
stevestrong
Posts: 1611
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [STM32GENERIC] Latest - issues

Post by stevestrong » Sun Jun 25, 2017 4:48 pm

For F1 one need "VERY_HIGH" (50MHz) GPIO speed, otherwise SPI@36MHz won't work.

Btw, I think the GPIO speed setting was set to "MEDIUM" due to Pito's recommendation for F4 SDIO to work.
Well, SDIO works for libmaple F4 with GPIO set to push-pull with enabled pull-up and the default push-pull speed "HIGH" (50MHz).

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] Latest - issues

Post by Pito » Sun Jun 25, 2017 6:13 pm

Btw, I think the GPIO speed setting was set to "MEDIUM" due to Pito's recommendation for F4 SDIO to work.
Trust, but verify :)
Here with VERY_HIGH gpio speed at SPI 36MHz, Samsung:

Code: Select all

Use a freshly formatted SD for best performance..
*************************************************
Opening the read file..
Opening the write file..
Reading and Writing..
*************************************************
Done in 89378 msecs
*************************************************
Running CRC calculations...
File in CRC:  22483A52
File out CRC: 22483A52
*************************************************
Done in 227120 msecs

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
3313.24,16622,144,152
3315.44,16601,144,152
3282.78,19821,144,153

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
3113.13,1503,161,162
3115.07,1397,161,162
3115.07,1394,161,162

Done
Seems the numbers a little bit lower than with Victor's SPI DMA in past (3566/3163)..

And with 44MHz SPI Samsung:

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
4229.85,9345,115,119
4244.21,9112,115,119
4291.57,7318,115,117

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
3822.39,989,132,132
3822.39,858,132,132
3819.47,860,132,132

Done
Sandisk 4050/3819. Interestingly Sandisk works now at 44MHz.
The SPI 48MHz throws above error for both cards.

PS: Let F407 SDIO at MEDIUM..
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] Latest - issues

Post by Pito » Sun Jul 16, 2017 7:23 am

These are 2 issues I see here with USB with the latest (local repo updated here on 24.6.) on Blue F103ZET board:

1. with the latest when compiled for SerialUSB the SerialUSB console is not recognized by Win7.
The upload via DFU works.

2. The SerialUSB is recognized when compiled with my previous local repo version and it works, but with the TX speed issue (there is the old CDC ACM driver used - it has to be patched with Steve's patch - https://github.com/stevstrong/Arduino_S ... 7d2281eadb ).
Pukao Hats Cleaning Services Ltd.

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] Latest - issues

Post by danieleff » Sun Jul 16, 2017 1:14 pm

Does it work with bluepill?
Not recognized means the yellow triangle in device manager? If so, try changing the USBD_VID to 0x1EAF, and USBD_CDC_PID_FS to 0x0004

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] Latest - issues

Post by Pito » Sun Jul 16, 2017 1:37 pm

It does work with MapleMini and the latest, connected via COM4 STM32 Virtual port. I do not have BP handy today.
It does work with Black F407ZET and the latest, connected via COM4 STM32 Virtual port.
There is the USBSerial TX issue, however (82x slower than normal).

The Blue F103ZET and the latest - I get a bubble message "USB device not recognized" when inserted the USB, with "Unknown device" in the DevMan, none yellow triangle in the DevMan.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] Latest - issues

Post by Pito » Sun Jul 16, 2017 4:40 pm

In the platform.txt there is several times used the flag

Code: Select all

-DARDUINO_ARCH_{build.arch}
and maybe it shall produce something like -DARDUINO_ARCH_STM32, but it does not, at least here.. :(

My folder with the latest repo is called "STM32DE1", and what I see in the compiler's log is

Code: Select all

.../4.8.3-2014q1/bin/arm-none-eabi-gcc" -mcpu=cortex-m3...
... -DSTM32F1 -DARDUINO=10802 -DARDUINO_BLUE_F103XX -DARDUINO_ARCH_STM32DE1 -DSTM32F103ZE
and it is obviously not good to get.. Btw, we use the flag in SdFat..
The same in libmaple..
Pukao Hats Cleaning Services Ltd.

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] Latest - issues

Post by danieleff » Sun Jul 16, 2017 5:48 pm

Rename your STM32DE1 folder to STM32, the folder name is the way to distinguish between multiple archs.

I will not be able to fix the USB issue with F103ZET, it should work as the code is the same as F103C. The difference is only clock setup, and maybe it has a USB_DISC_PIN.

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] Latest - issues

Post by Pito » Sun Jul 16, 2017 6:22 pm

:twisted: You are right, I messed with clock settings in variant.c.. I had 7 there.. :cry:
Now the F103ZE connects.. Thanks.

What about the USBSerial Tx patch - your core is using different files as the libmaple, it seems..
I patched the libmaple core today - https://github.com/stevstrong/Arduino_S ... 7d2281eadb
and the Tx speed went from 9k6 to ~1000k.. Your core is 9k6..

The -DARDUINO_ARCH flag - I think it is a bad idea to derive the architecture name based on the repo folder's name.. :?
I will hard-wire it ARDUINO_ARCH_STM32 here in my platform.txt, as I am using 8 folders for various repos (and their different versions) here.
And Roger has in his libmaple the folders called STM32F1, STM32F3, STM32F4 in there - and the arch is ARDUINO_ARCH_STM32 (at least SdFat is using that flag).
Moreover, everything in stm32duino is _STM32 architecture.. :)
Pukao Hats Cleaning Services Ltd.

vitor_boss
Posts: 61
Joined: Wed Apr 19, 2017 9:50 am

Re: [STM32GENERIC] Latest - issues

Post by vitor_boss » Tue Aug 01, 2017 12:21 am

Serial.available() is not working properly.

My code use a lot of that to check list of commands, but it is currently return a Bool result instead number of bytes
Actual code:

Code: Select all

int SerialUART::available() {
    return rxEnd != rxStart;
}
I have changed to that but I'm not sure if is right, but is working:

Code: Select all

int SerialUART::available() {
    int result = rxEnd - rxStart;
    if(result == BUFFER_SIZE) { return 0; }
    else { return result; }
}
That is on file SerialUART.cpp

Post Reply