I’m running stm32_graphicstest with these defines:
#define TFT_CS PB4 //10 pin 3 10
#define TFT_DC PC15 // 9 pin 5 9
#define TFT_RST PB3
Check that I am correct before you try this obviously, or you will have purchased your membership of the stm32duino magic smoke club.
Note. I didn’t check any of the other pins. We can do that once we are happy that we have the correct power.
I don’t know what to think about this. If I flash the basic ‘blink’ program it works when flashing via ST-Link dongle.
But I don’t really think that it goes wrong during flashing with the dongle.
To further check the issue, you should monitor the supply voltage and SPI lines in both cases.
When you are using the bootloader, the dongle is not connected anymore, right? So the power supply has different condition.
If I flash with bootloader and power device by the same USB or by connecting ST-LINK –> OK.
If I flash with ST Link and power device by USB or by connecting ST-LINK (or have both connected) –> Not OK.
Something goes not right when flashing with ST-Link or is my thinking not correct here.. please help ![]()
EDIT: I verified flash contents with STM32 ST-Link utility. The flash contents are identical to the file. Does bootloader load something into memory during startup – something that does not happen when there is no bootloader ?
Try a simple blink sketch using both methods. I use ST-Link all the time, and don’t have any issues.
Try a simple blink sketch using both methods. I use ST-Link all the time, and don’t have any issues.
Try a simple blink sketch using both methods. I use ST-Link all the time, and don’t have any issues.
Try a simple blink sketch using both methods. I use ST-Link all the time, and don’t have any issues.
Sketch uses 25,916 bytes (39%) of program storage space. Maximum is 65,536 bytes.
Global variables use 11,904 bytes of dynamic memory.
C:\Users\mika\Documents\Arduino\hardware\Arduino_STM32/tools/win/stlink_upload.bat COM19 {upload.altID} {upload.usbID} C:\Users\mika\AppData\Local\Temp\builde7beee08ccdcd28160514e2a426c5306.tmp/rtos_blink_mika.ino.bin
STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface
ST-LINK SN : 48FF6C064970535623390887
ST-LINK Firmware version : V2J24S4
Connected via SWD.
SWD Frequency = 1800K.
Connection mode : Normal.
Device ID:0x410
Device flash Size : 64 Kbytes
Device family :STM32F10xx Medium-density
Loading file…
Flash Programming:
File : C:\Users\mika\AppData\Local\Temp\builde7beee08ccdcd28160514e2a426c5306.tmp\rtos_blink_mika.ino.bin
Address : 0x08000000
Flash memory programming…
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 29%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 59%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 88%ÛÛÛÛÛÛ 100%
Flash memory programmed in 2s and 74ms.
Programming Complete.
MCU Reset.
Application started.
What I see is something like..
Sketch uses 16,604 bytes (12%) of program storage space. Maximum is 131,072 bytes.
Global variables use 2,720 bytes of dynamic memory.
USB Status [ttyACMx]
2016-07-18T12:50:15 INFO src/stlink-common.c: Loading device parameters....
2016-07-18T12:50:15 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2016-07-18T12:50:15 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2016-07-18T12:50:15 INFO src/stlink-common.c: Attempting to write 16604 (0x40dc) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08004000 erased
2016-07-18T12:50:16 INFO src/stlink-common.c: Finished erasing 17 pages of 1024 (0x400) bytes
2016-07-18T12:50:16 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2016-07-18T12:50:16 INFO src/stlink-common.c: Successfully loaded flash loader in sram
16/16 pages written2016-07-18T12:50:16 INFO src/stlink-common.c: Starting verification of write complete
2016-07-18T12:50:17 INFO src/stlink-common.c: Flash written and verified! jolly good!
USB Status [ttyACMx] Waiting for tty device /dev/ttyACM3
/dev/ttyACM3 should now be available.
I did not short J1, Seems to work fine that way.
Both are tied up at this time, one is on a F4 Nucleo and the other is on a RPi3, but I hope to try them soon with stm32duino.
What demo are you using?
What I see is something like..
Sketch uses 16,604 bytes (12%) of program storage space. Maximum is 131,072 bytes.
Global variables use 2,720 bytes of dynamic memory.
USB Status [ttyACMx]
2016-07-18T12:50:15 INFO src/stlink-common.c: Loading device parameters....
2016-07-18T12:50:15 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2016-07-18T12:50:15 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2016-07-18T12:50:15 INFO src/stlink-common.c: Attempting to write 16604 (0x40dc) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08004000 erased
2016-07-18T12:50:16 INFO src/stlink-common.c: Finished erasing 17 pages of 1024 (0x400) bytes
2016-07-18T12:50:16 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2016-07-18T12:50:16 INFO src/stlink-common.c: Successfully loaded flash loader in sram
16/16 pages written2016-07-18T12:50:16 INFO src/stlink-common.c: Starting verification of write complete
2016-07-18T12:50:17 INFO src/stlink-common.c: Flash written and verified! jolly good!
USB Status [ttyACMx] Waiting for tty device /dev/ttyACM3
/dev/ttyACM3 should now be available.
#define TFT_CS PC13 //10 pin 3 10
#define TFT_DC PC15 // 9 pin 5 9
#define TFT_RST PC14 // 8 pin 4 8
So my conclusion is that I’ve chosen “wrong” pins in BP that don’t play ball when flashing with St Link because they don’t get initialized.. *OR* stm32duino bootloader does init some pins in a way that makes it work
you only need to connect 3; swclk, swdat and then gnd to the common ground of pill and display.
stephen
Anyway, the 4 wires could be Reset, SWDIO, SWCLK and GND and still would not include 3.3V
all my usb ‘clone’ stlinks, it’s 3v3 and seems sufficient to power the board.
just thought it was worth mentioning as a doubt about the power supply aspect had been raised earlier in the thread.
stephen
<edit more correctly defined 3v3 & adc f/back /edit>
#define TFT_CS PC13
#define TFT_DC PC15
#define TFT_RST PC14
PC13 is user led but that does not seem to bother.
So for some reason using these and flashing with ST Link result in white screen. Are these pins okay to use ?
#define TFT_CS PB4 //10 pin 3 10
#define TFT_DC PA15 // 9 pin 5 9
#define TFT_RST PB3 // 8 pin 4 8

