I am currently messing with the BLUE 103ZE variant (see updated BLUE Boards variants in another thread) trying to build the SDCopy demo with F103ZE and SPI/Sdfat. So far I get
In file included from C:/Users/pito/MyCode/Arduino/hardware/Arduino_STM32SerBuff/STM32DE1/system/STM32F1/CMSIS_Inc/stm32f1xx.h:151:0,
from C:/Users/pito/MyCode/Arduino/hardware/Arduino_STM32SerBuff/STM32DE1/cores/arduino/stm32/stm32_def.h:10,
from C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32SerBuff\STM32DE1\libraries\stm32_dma\src\stm32_dma.c:23:
C:/Users/pito/MyCode/Arduino/hardware/Arduino_STM32SerBuff/STM32DE1/system/STM32F1/CMSIS_Inc/stm32f103xe.h:12157:39: error: redefinition of 'DMA2_Channel4_5_IRQHandler'
#define DMA2_Channel4_IRQHandler DMA2_Channel4_5_IRQHandler
^
C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32SerBuff\STM32DE1\libraries\stm32_dma\src\stm32_dma.c:268:13: note: in expansion of macro 'DMA2_Channel4_IRQHandler'
extern void DMA2_Channel4_IRQHandler() {
^
C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32SerBuff\STM32DE1\libraries\stm32_dma\src\stm32_dma.c:262:13: note: previous definition of 'DMA2_Channel4_5_IRQHandler' was here
extern void DMA2_Channel4_5_IRQHandler() {
^#define __HAL_AFIO_REMAP_SPI3_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SPI3_REMAP)[Pito – Fri Jun 23, 2017 11:12 am] –
Could you try to run the SDcopy wih SPI on an F103 with your setup there, plz?
Libmaple core: BP, CPU@72MHz, SPI_1@36MHz, flash wait states = 1, BUFSIZE = 14kB (more does not fit into RAM):
#################################################
Opening the read file..
Opening the write file..
Reading and Writing..
File size = 102400000 bytes.
*************************************************
Done in 76582 msecs
*************************************************
Running CRC calculations...
*************************************************
*************************************************
File in CRC: 22BCDBEC
File out CRC: 22BCDBEC
*************************************************
Done in 253858 msecs
After an hour coping with errors I finally added to compile options the new ARCH flag (Blue F103ZET, 72/18MHz, SPI, SdFatEX, Buf=32kB, 2MB file)
-DSTM32F1 -D__STM32F1__ -DARDUINO_ARCH_STM32[stevestrong – Sun Jun 25, 2017 9:11 am] –
And how is performing with a 102400kB file?
F103ZET, 72MHz, 18MHz SPI, flash ws=2, Buffersize = 32kB, SdFatEX, 104.4MB file, Samsung EVO CL10
Use a freshly formatted SD for best performance..
*************************************************
Opening the read file..
Opening the write file..
Reading and Writing..
*************************************************
Done in 135574 msecs
*************************************************
Running CRC calculations...
File in CRC: 22483A52
File out CRC: 22483A52
*************************************************
Done in 266093 msecs
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
1946.16,24128,254,261
1964.51,11305,254,258
1926.66,36394,254,263
Starting read test, please wait.
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1984.79,1155,255,256
1984.79,1154,255,256
1984.79,1155,255,256
Done
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
to
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
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).
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:
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 msecs1. 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 ).
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
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.
-DARDUINO_ARCH_{build.arch}
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.
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.. ![]()
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:
int SerialUART::available() {
return rxEnd != rxStart;
}
