Ok, now when you have the STLINK V2 programmer available do a little test with the typical Blink LED on the PC13 port to make sure everything works correctly, before programming it with the code for the LS-30:
void setup() {
// initialize digital pin PC13 as an output.
pinMode(PC13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
RndMnkIII wrote: ↑Sat Aug 13, 2022 11:46 am
Ok, now when you have the STLINK V2 programmer available do a little test with the typical Blink LED on the PC13 port to make sure everything works correctly, before programming it with the code for the LS-30:
void setup() {
// initialize digital pin PC13 as an output.
pinMode(PC13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Ok, I have updated my arduino sofware from 1.8.13 to 1.8.19 and double checked my version of the STM32 I purchased and it's definitely listed as this part number:- STM32F103C6T6 ARM STM32 so my selection on the the drop down after selecting the Generic STM32F1 series would differ slightly from the board you are using, i.e. the F103CB.
As we know your LS-30 code is confirmed working with the F103CB module so I will do a trial program of the blinking program as you suggested first to see if everything programs ok.
Thanks for all your help so far, it's been a bit of a learning curve for me but I hope it also helps others on the forum wanting to building your adapter and get it up and running.
...and thanks for the superb SNK core, was one of my favourite 2 player games in the arcades when I was a child
I'm excited to see that someone else apart from me built this adapter, the feeling playing with the original controller in MiSTer is very good and I wanted to give others the opportunity to experience it.
Remember to double check the wiring connections, especially the LS-30 connector and the ground cable, any mistake here and you will get crazy results.
I thought I would double check my wiring whilst waiting for my STM32 V2 link programmer to turn up and noticed from the schematics you have the following pins that require connecting on the USB 3.0 female connector
but looking at your actual set up you only have Pin2 (D-) Pin 3 (D+) and pin 7 (TX-) connected. The same 3 connections can also only be seen connected when you have installed all your components within your completed LS-30 controller box.
USB 3.0 connector circuit.PNG (20.92 KiB) Viewed 4942 times
USB connection - STM32.PNG (642.61 KiB) Viewed 4942 times
USB 3.0 connections Controller box.PNG (234.29 KiB) Viewed 4942 times
I currently have the +5v and GND connected so do I need to remove these connections or can I leave them connected?.
Is required to connect 5 pins: VBUS(VCC), GND, D-(CLK), D+(LOAD), and TX-(DATA). When the blue pill will be connected to the USERIO port of the MiSTer using a USB3 male to male cable, this is and must be the only source of power for the microcontroller.
Unfortunately I did not notice that that photo that I uploaded the power supply was not yet connected to the USB3 connector.
RndMnkIII wrote: ↑Mon Aug 15, 2022 11:56 am
Is required to connect 5 pins: VBUS(VCC), GND, D-(CLK), D+(LOAD), and TX-(DATA). When the blue pill will be connected to the USERIO port of the MiSTer using a USB3 male to male cable, this is and must be the only source of power for the microcontroller.
Unfortunately I did not notice that that photo that I uploaded the power supply was not yet connected to the USB3 connector.
No problem thanks for confirming
Programmer arrived today so will trying to program the blinking led project, ill let you know how it goes.
The reason why the power don't appear connected to the USB3 connector in these photos is related to what I said about only having connected a single 5v power supply to the Blue Pill, as I was doing tests on the PC I had it powered from the USB of the computer using the micro USB of the Blue Pill board directly and to avoid accidentally powering it through the USB3 adapter I disconnected the VCC and GND cables.
Ok I just tried uploading the blinking LED sketch to the STM32 and received this error
arm-none-eabi-g++: error: 5593\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.3.0=.: No such file or directory
exit status 1
Error compiling for board Generic STM32F1 series.
Strange, I just check on my PC and this directory of AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.3.0 does exist with sub directory file content so not sure as to what files Arduino is supposedly looking for??
I'll try reinstalling the STM32CubeProgrammer software again
You should do a clean Arduino IDE + STM32Duino install. This means delete all Arduino files including all the AppData\Local\Arduino15 folder (this could need to do manually).
https://github.com/stm32duino/wiki/wiki/Getting-Started
Only follow this guide in the software installation part. As uses a different SMT32 board (Nucleo board) as example,
you should skip the whole part where the configuration of the STM32 board is detailed since it is different (it is for a Nucleo board not a Blue Pill) to what you have to do with the Blue Pill (using the STLINK v2)
Ok thanks I'm doing a clean install now and will use the board manage directory you suggested in your earlier post to add in the supported board libraries.
This is really the most tedious part if it is the first time you do it, once the tools work correctly it is very easy and fast to program the Blue Pill.
1- Launch Arduino.cc IDE. Click on "File" menu and then "Preferences".
The "Preferences" dialog will open, then add the following link to the "Additional Boards Managers URLs" field:
Still a no go this is my Arduino programming screen with the same error. Arduino knows that the STM32 board is connected but the ino file will compile and upload to the board.
You are using wrong settings for the compiler. If you Blue Pill is the STM32F103CB, STM32F103C8 or STM32F103C6 select the correct device and for programming you will not used a port, because you will use the STLINK V2 (STM32CubeProgrammer(SWD), so see my Arduino settings for reference:
arduino_stlinkv2_bluepill_settings.png (36.32 KiB) Viewed 4736 times
Sorry I was just mentioning my 'Port' was greyed out as following the earlier guide you send me I noticed that guy had it showing even though he was using a different STM32 based board (Nucleo 64) hence why i asked why my port was selection was greyed out.
For programming the STM32 I understand the programming is only via the 4 coloured wired connection to the STM32 blue pill.
I checked the part number on the actual surface mount processor and it's printed as STM32 103C6T6A and this is my board selection when I am pressing the upload button within the Arduino software
Programmer selection.png (111.73 KiB) Viewed 4709 times
I Downloaded the correct STM32 packages from your posted link and have also reinstalled the STM32CubeProgrammer software again and Arduino is still saying that it can't read the directory contents of the following directory:-
5593\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.3.0=.: No such file or directory
Here is the contents of that missing directory which is present on my PC:-
Arduino STM32 2.3.0 Installation Package.PNG (92.3 KiB) Viewed 4709 times
There are many factors that can cause the compiler to fail here: antivirus that sees the IDE activity as suspicious, file access permissions, environment variables, the only thing I can tell you is that it works correctly on my computer, I don't know what it can go wrong, try to use a slightly older version of arduino 1.8.18 or 1.8.16, but remove al files before try a different version (not need to reinstall STM32CubeProgrammer): https://www.arduino.cc/en/software/OldSoftwareReleases
arm-none-eabi-g++: error: 5593\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.3.0=.: No such file or directory
Seems that the arm executable dont understand the folder name as "Dell 5593", but instead only sees "5593". There are many development and compiler tools that have problems with folder names that includes spaces. You could try create a user without space characters?