Speeduino is now on Github Sponsors (Rather than Patreon): https://github.com/sponsors/noisymime
Any general discussion around the firmware, what is does, how it does it etc.
By NickZ
#45244
i havent come across that problem. but im using my own custom stm32f407 board, i did find that the default board pin configuration is used and it crashed my board, i think if you go direct to the TS settings and reselect the blackstm32 and reboot may be a option to try before doing anything.
User avatar
By Trinom
#45248
Well, reselecting STM32 board didn't change anything, so I selected Speeduino v0.1 (the original configuration it showed me after the flash) and it stopped communicating. Apparently it wrote that settings to the external flash and now it tries to use a different UART or something. After some some datasheet check I managed to write a quick flash erase tool, that brought the board back to life. And to my surprise, it's not all INVALID, but mainly BOARD DEFAULT. That means the flash didn't arrive clear, but with some data stored inside. There are still some INVALID I/Os, but I guess they should be user assignable.
Image

EDIT: After manual setting programmable output pins to some port and back to disabled state, all the warnings went out. So it looks like, it will need a default tune to come with the speeduino library.
Image
By pazi88
#45249
You are seeing invalid, because the STM32 pin mappings are usually in form of "PB0" or "PE5" etc. but arduino mega pin mappings are just number. Or A and number for analog pins and that's what the TS is expecting.

I did work around the issue by modifying the variant files in the core so that normal arduino pin numbers match what is the stm32 pin used for that purpose (because the board has the stm32 form factor). So in that case, when I now select pin3 for example in TS, it's correct pin in the board. And the I/O summary also works as it should. Also the critical pins like SPI and USB ones are mapped to pin numbers that you cannot access in TS, so you can't brick the board if for example you accidentally use USB pin for idle for example. Or select wrong board.
Untitled.png
Untitled.png (23.74 KiB) Viewed 585 times
20200903_183956.jpg
20200903_183956.jpg (493.13 KiB) Viewed 585 times
User avatar
By Trinom
#45251
And would you mind sharing those modified files? I guess it would be useful for more people.
Thx
By NickZ
#45275
didn't think of the pin settings, I have my own pin defines so i didn't have the same problem.
User avatar
By Trinom
#45288
Heureka, I've found the pin definition in the init.ino file. Now it makes all sense ;)

EDIT: It's way more complex. For example the Baro input doesn't work at all. I've found, that there is also several settings in .ini file for TunerStudio. Apparently the key is "Board default" settings, however in case of Baro input, it does nothing.
In init.ino file, there is
Code: Select all
pinBaro = PB1; //ADC12
so I would expect it should work, but it doesn't. It still takes a floating average from MAP value, even though I've set external Baro sensor to YES in pressure sensors calibration of TunerStudio.
Any ideas, where to look for the problem :( ? Thanks.
By Tjeerd
#45532
@Trinom The board defaults is what i usually use. I also always choose Black STM32F407VET6 V0.1 (Last one in the board list from TS) This one is compatible with my own board. The pinout is case 60: in init.ino see:

//******************************************
//******** PORTA CONNECTIONS ***************
//******************************************
// = PA0; //Wakeup ADC123
// = PA1; //ADC123
// = PA2; //ADC123
// = PA3; //ADC123
// = PA4; //ADC12
// = PA5; //ADC12
// = PA6; //ADC12 LED_BUILTIN_1
// = PA7; //ADC12 LED_BUILTIN_2
pinCoil3 = PA8;
// = PA9; //TXD1=Bluetooth module
// = PA10; //RXD1=Bluetooth module
// = PA11; //(DO NOT USE FOR SPEEDUINO) USB
// = PA12; //(DO NOT USE FOR SPEEDUINO) USB
// = PA13; //(DO NOT USE FOR SPEEDUINO) NOT ON GPIO - DEBUG ST-LINK
// = PA14; //(DO NOT USE FOR SPEEDUINO) NOT ON GPIO - DEBUG ST-LINK
// = PA15; //(DO NOT USE FOR SPEEDUINO) NOT ON GPIO - DEBUG ST-LINK

//******************************************
//******** PORTB CONNECTIONS ***************
//******************************************
// = PB0; //(DO NOT USE FOR SPEEDUINO) ADC123 - SPI FLASH CHIP CS pin
pinBaro = PB1; //ADC12
// = PB2; //(DO NOT USE FOR SPEEDUINO) BOOT1
// = PB3; //(DO NOT USE FOR SPEEDUINO) SPI1_SCK FLASH CHIP
// = PB4; //(DO NOT USE FOR SPEEDUINO) SPI1_MISO FLASH CHIP
// = PB5; //(DO NOT USE FOR SPEEDUINO) SPI1_MOSI FLASH CHIP
// = PB6; //NRF_CE
// = PB7; //NRF_CS
// = PB8; //NRF_IRQ
pinCoil2 = PB9; //
// = PB9; //
// = PB10; //TXD3
// = PB11; //RXD3
// = PB12; //
// = PB13; //SPI2_SCK
// = PB14; //SPI2_MISO
// = PB15; //SPI2_MOSI

//******************************************
//******** PORTC CONNECTIONS ***************
//******************************************
pinIAT = PC0; //ADC123
pinTPS = PC1; //ADC123
pinMAP = PC2; //ADC123
pinCLT = PC3; //ADC123
pinO2 = PC4; //ADC12
pinBat = PC5; //ADC12
pinBoost = PC6; //
pinIdle1 = PC7; //
// = PC8; //(DO NOT USE FOR SPEEDUINO) - SDIO_D0
// = PC9; //(DO NOT USE FOR SPEEDUINO) - SDIO_D1
// = PC10; //(DO NOT USE FOR SPEEDUINO) - SDIO_D2
// = PC11; //(DO NOT USE FOR SPEEDUINO) - SDIO_D3
// = PC12; //(DO NOT USE FOR SPEEDUINO) - SDIO_SCK
pinTachOut = PC13; //
// = PC14; //(DO NOT USE FOR SPEEDUINO) - OSC32_IN
// = PC15; //(DO NOT USE FOR SPEEDUINO) - OSC32_OUT

//******************************************
//******** PORTD CONNECTIONS ***************
//******************************************
// = PD0; //CANRX
// = PD1; //CANTX
// = PD2; //(DO NOT USE FOR SPEEDUINO) - SDIO_CMD
pinIdle2 = PD3; //
// = PD4; //
pinFlex = PD4;
// = PD5; //TXD2
// = PD6; //RXD2
pinCoil1 = PD7; //
// = PD7; //
// = PD8; //
pinCoil5 = PD9;//
pinCoil4 = PD10;//
// = PD11; //
pinInjector1 = PD12; //
pinInjector2 = PD13; //
pinInjector3 = PD14; //
pinInjector4 = PD15; //

//******************************************
//******** PORTE CONNECTIONS ***************
//******************************************
pinTrigger = PE0; //
pinTrigger2 = PE1; //
pinStepperEnable = PE2; //
pinFuelPump = PE3; //ONBOARD KEY1
// = PE4; //ONBOARD KEY2
pinStepperStep = PE5; //
pinFan = PE6; //
pinStepperDir = PE7; //
// = PE8; //
pinInjector5 = PE9; //
// = PE10; //
pinInjector6 = PE11; //
// = PE12; //
pinInjector8 = PE13; //
pinInjector7 = PE14; //
// = PE15; //

Be careful with programmable outputs/inputs these can make the board lockup in many ways. If you for example choose pin 20/21 for some other function the USB stops working. So Just disable them all if you starting to explore the firmware.
Last edited by Tjeerd on Wed Sep 23, 2020 7:27 pm, edited 1 time in total.
By Tjeerd
#45533
Standard dec to STM32 pins in variant.h is:

// Right Side
#define PE1 0
#define PE0 1
#define PB9 2
#define PB8 3
#define PB7 4
#define PB6 5
#define PB5 6
#define PB3 7
#define PD7 8
#define PD6 9
#define PD5 10
#define PD4 11
#define PD3 12
#define PD2 13
#define PD1 14
#define PD0 15
#define PC12 16
#define PC11 17
#define PC10 18
#define PA15 19
#define PA12 20 // USB_DP
#define PA11 21 // USB_DM
#define PA10 22
#define PA9 23
#define PA8 24
#define PC9 25
#define PC8 26
#define PC7 27
#define PC6 28
#define PD15 29
#define PD14 30
#define PD13 31
#define PD12 32
#define PD11 33
#define PD10 34
#define PD9 35
#define PD8 36
#define PB15 37

// Left Side
#define PE2 38
#define PE3 39
#define PE4 40 // BUT K0
#define PE5 41 // BUT K1
#define PE6 42
#define PC13 43
#define PC0 44 // A0
#define PC1 45 // A1
#define PC2 46 // A2
#define PC3 47 // A3
#define PA0 48 // A4/WK_UP: BUT K_UP
#define PA1 49 // A5
#define PA2 50 // A6
#define PA3 51 // A7
#define PA4 52 // A8
#define PA5 53 // A9
#define PC4 54 // A10
#define PC5 55 // A11
#define PB0 56 // A12
#define PB1 57 // A13
#define PA6 58 // LED D2
#define PA7 59 // LED D3 (active LOW)
#define PE7 60
#define PE8 61
#define PE9 62
#define PE10 63
#define PE11 64
#define PE12 65
#define PE13 66
#define PE14 67
#define PE15 68
#define PB10 69
#define PB11 70
#define PB12 71
#define PB13 72
#define PB14 73
#define PB4 74
User avatar
By Trinom
#45559
Thanks for the reply. I am aware of the settings in init.ino, but I don't need to change anything at the moment. My only trouble is, that the external baro isn't working for me and I don't know, why. It should use PB1, but I don't see any change in TunerStudio.
//******************************************
//******** PORTB CONNECTIONS ***************
//******************************************
// = PB0; //(DO NOT USE FOR SPEEDUINO) ADC123 - SPI FLASH CHIP CS pin
pinBaro = PB1; //ADC12
// = PB2; //(DO NOT USE FOR SPEEDUINO) BOOT1
At this moment, I have just a potentiometer hooked up between 3V3 rail and GND with output connected to whatever pin I need, so I can test all the inputs. The rest of the inputs work fine for me, only the baro input (PB1) doesn't. The input is set as "board default", which should not override any settings. In fact, it behaves as MAP input copy with floating average over huge amount of samples.
Image
  • 1
  • 11
  • 12
  • 13
  • 14
  • 15
2CV 602 flat twin

Is it the 123 with the MAP feature? What engine ma[…]

PCB for Electromotive Tec3r

What do you think about this BM2LC120FJ-C for re[…]

I did this on a 92 miata with a vvt engine as well[…]

Unfortunately this probably won't work. The MX5 […]

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