Any general discussion around the firmware, what is does, how it does it etc.
By Tjeerd
#26572
Hi All,

I find the speeduino project very interesting! I did an EFI project with a microsquirt (megasquirt efi system) before (still not running perfect but it works). I have one speeduino working on my bench with a little help of the ardustim. Very nice.

For now i am trying to get the speeduino code working on the STM32F407VET6 as a side project (https://www.ebay.com/itm/253073739790) What is the status on the STM32 versions?

The first hurdle is the missing EEPROM of course. Has someone already tried to get the spimemory library and the onboard SPIflash chips working? (W25Q16 for my example board)? What else is missing in the code for the STM32 versions so far? I see a lot of code already tailored for the STM32 boards but it does not work completely as i understand form various forum posts. I want to help implementing and debugging the missing stuff, but i don't want to do the work twice of course. :-D.


------------------------------------------- below this line info will be updated from time to time with the latest and greatest -------------------------------------------
This is the updated manual to compile/test the code on a Black stm32F407VET6 board from eBay.

Install tool chain
1. Install the arduino IDE (1.8.12)
2. Install the stm32duino core from: https://github.com/stm32duino/Arduino_Core_STM32 (version 2.0.0)
3. install https://www.st.com/content/st_com/en/pr ... eprog.html

Build code
1.a For bleeding edge Download the speeduino master code from noisy master (https://github.com/noisymime/speeduino) or alternatively from (https://github.com/Tjeerdie/speeduino). I try to keep an STM32 working version in my Master branch at all times.
1.b Release 202108 can be downloaded and that works fine on STM32F407 and not on STM32F4x1.
2. Open the code in de arduino IDE.
3. In arduino IDE select Tools->Board: GENERIC STM32F4 series
4. In Arduino IDE select Tools->Board part number: "BLACK F407VE" (or one of the other supported MCUs)
5. In Arduino IDE select Tools->USART support: Enabled (generic serial)
6. In Arduino IDE select Tools->USB support: CDC (generic serial)
7. If internal flash as emulated EEPROM is ok, skip step 8 and 9:
8. Open the globals.h file located in project folder
9. Look at line 84..87 and select your storage solution. When there is no selection the internal flash is used.
10. Build the speeduino project.

Hardware modifications STM32F407VE black boards
1. Remove the R21 resistor from the board (close to USB port)

Upload
1. Put the jumper close to the CPU (BT0) to connect to the 3.3 volt instead of GND (one step up)
2. Reset the board.
3. In Arduino IDE select Programmer: "STM32CubeProgrammer DFU"
4. Upload the code
5. Put the Jumper back in its original position.
4. Reset the board

After these steps you should be able to connect to the board using the USB cable and use tuner studio. Tested the compilation in Linux Ubuntu 18.04.3 LTS. When there is no SPI flash available but this is selected as EEPROM emulation or the incorrect chip select pin (CSpin) is selected for the flash chip, the board will lockup during boot.

To select the CSpin for SPI flash change the #define USE_SPI_EEPROM PB0 in globals.h to the pin number where to find the correct pin.

--- Compatible hardware designs ----
https://github.com/Tjeerdie/SPECTRE maintainer Tjeerd
https://stm32-base.org/boards/STM32F407 ... -V1.0.html maintainer iLeeeZi
https://easyeda.com/pazi88/Arduino_Mega_2560-z92kCUO6o maintainer pazi88

--- Compatible STM32 MCU ----
STM32F407VE Fully functional
STM32F407ZET Connects to Tuner Studio (In Arduino IDE Choose "black F407ZE")

For 202108 stm32F4x1 are broken. Master is working at the moment (12/09/2021)
STM32F411CE @vitor_boss has a car running on these . (In Arduino IDE Choose "blackPill F411CE")
STM32F401CC (In Arduino IDE Choose "blackPill F401CC")
Last edited by Tjeerd on Sun Sep 12, 2021 1:40 pm, edited 14 times in total.
By noisymime
#26580
The EEPROM/Storage should be working (it was when I last tried it), but there were still a few issues that were causing some lockups under various conditions etc. It will compile up and take a tune in its current form though.

We're definitely targeting the stm32F407 platform though, so you're on the right track there. Initially the work had been on the lower spec'd units (Eg stm32F103 aka Bluepill) but we ran into a lot of limitations on those MCUs.
By Tjeerd
#26591
Hi,

What core system are you using for the development of the stm32? I tried it with the stm32duino, and that worked EEPROM wise for the maple mini (but complained about something else), but not when selecting the STM32F407V board. All done using the Arduino IDE version 1.8.5

In addition, I assume you people are not developing with the Arduino IDE anymore. The system is excessively big to comfortably work with the Arduino IDE I think. What IDE are you using?
By noisymime
#26592
It still should compile up in the Arduino IDE using stm32duino, but I haven't done any development in that IDE for years now.

Everything I'm doing these days is with PlatformIO, through either VS Code or Atom, depending on my mood that day :D
Once you've got PlatformIO installed on either of those platforms, you should just be able to point it at the Speeduino directory and it will pickup the pltformIO config and download everything you need for all 3 of the platforms under development (2560, teensy 3.5/3.6 and stm32f407)
By Tjeerd
#26599
I did finally get it to work in the arduino IDE with a fresh install under windows. I figured i needed the STM32GENERIC core after finding some macros in the code referencing this directly. Core and installation can be found here: https://github.com/danieleff/STM32GENERIC

There are some changes needed to get it to compile but nothing major.

On my Linux distribution i did not get it to work properly using the arduino IDE. Maybe because i have so many different board platforms installed or something. Now installing platform IO :-D
By dazq
#26602
The stmgeneric and Arduino IDE are fine to use, I still only use the Arduino IDE for all my stm8,32 , samC , samD and all teensy development work with no issues :-)
By Tjeerd
#32278
Hi All

A lot later than I originally thought. I have something that at least outputs some pulses:-D. (very alpha stage of development) on a black_stm32F407VET6 ebay board. I switched to the official ST stm32duino core because the stm32GENERIC and the stm32duino core by rogerclarkmelbourne are no longer developed. In the process of upgrading, I did break the compatibility with the two afore mentioned cores.

What works:
- Holds a tune using the battery backuped sram as EEPROM (4 months already on the original battery)
- 4 injector output channels tested full sequential with ardustim
- 4 ignition output channels tested
- TPS/MAP/TEMP inputs al change with different input voltages
- Communication over Serial 1 (no usb)

My fork of the speeduino code: development done in the stm32F407VE branch.
https://github.com/Tjeerdie/speeduino

For the timers/schedule to work the ST stm32duino core needs an update/change. I did a pull request to make the changes permanent for the next release. My fork of the ST core can be found here for now: https://github.com/Tjeerdie/Arduino_Core_STM32

Still TODO:
- Backup the battery backuped sram to the SPI EEPROM
- Make a board that is compatible (I started on that but nothing working yet)
- Clean up!
- Lots of testing!
By noisymime
#32279
Great stuff! I'll happily look at pulling this in if you want to raise a PR

Just to confirm, this is using the official stm32 Core? I'd been targeting my work on the STM32_GENERIC core, but that one is slightly more painful to work with (Though does have working EEPROM support).

Around the hardware side of things, I have the beginnings of a new design, including an external flash library working as this I suspect may be the better option on these MCUs. The write time for the internal emulated EEPROM is extremely slow, in my testing and in others.
By Tjeerd
#32281
I am working with the official ST core indeed. As far as I know the STM32GENERIC core is not developed any more.
Before I make a pull request, I want to make sure I did not break the mega or teensy implementation. I did switch quite a bit with some functions. The "void setPinMapping(byte boardID)" has been placed in the board specific location (stm32_board.ino). Also I need to clean-up a bit :-D. hopefully I find time this weekend to do so.

The EEPROM used in the STM32GENERIC version did not work for me a couple of months back. It makes only 1k byte of EEPROM available. That is not enough for everything. The battery backup sram is just ram and therefor extremely fast! (4kbyte) )you could even consider mapping all the configuration variables on to that bit of ram for the stm32 black, than the configuration is automatically saved when changing it during tuning.

I am targeting the black_stm32F407VE boards from ebay. These already have the battery for backup sram/RTC and a 16Mbit spi eeprom onboard.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 30

It looks like you have a fuel supply issue. readin[…]

Will this have an updated version about this featu[…]

Vr Conditioner Noise when cranking

I did the fix, but it's not work. I put my setti[…]

Perhaps some different points and pictures. Instr[…]

Still can't find what you're looking for?