Page 1 of 1

Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 1:43 pm
by opelpanfan
Compiled custom FW based on hellen72 config but can set trigger pins PE2-PE5 and others (except to PA7).

FW compiled with no issues with options
DDEFS += -DHAL_TRIGGER_USE_PAL=TRUE
DDEFS += -DHAL_VSS_USE_PAL=TRUE

As soon as I set pin to PE2 Critical alert LED lights up and get Error message in TS "Invalid Trigger #1 input pin: PE2"
image.png

Re: Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 2:28 pm
by AndreyB
Let's take a step back - why do you need a custom FW based on Hellen72? What hardware is this for, what's the bigger picture?

Looks like PE2 is not a valid ICU pin, please look around the following code

Code: Select all

digital_input_s* startDigitalCapture(const char *msg, brain_pin_e brainPin) {
	ICUDriver *driver = getInputCaptureDriver(msg, brainPin);
	if (!driver) {
		firmwareError(CUSTOM_ERR_INVALID_INPUT_ICU_PIN, "Invalid %s input pin: %s", msg, hwPortname(brainPin));
		return nullptr;
	}
the whole ICU vs PAL switch is a nightmare and something I am ashamed of. Major technical debt in this area.

Re: Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 2:56 pm
by opelpanfan
Ok, Step back:
I only used Hellen board build files as an example to get my head around how to build custom FW.
The hardware I use is my custom STM32f407ZG board. Board has 24 LOW sides through VNLD5090, then 12 HIGH sides through TC4424, 2 Canbus, 2 14point7 lambda, 12 analog inputs, 8 digital inputs, 4 vr through max9926, 4 status LED, 2 sensor 5v supply, LPS25/22 I2C bar, RTC and SD card through SDIO.

Bigger picture I want to run this board on my c20LET (Opel Calibra Turbo) engine and multiple other cars.
Recompiled with ICU disabled and now works.

Re: Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 3:38 pm
by AndreyB
opelpanfan wrote:
Thu Oct 07, 2021 2:56 pm
The hardware I use is my custom STM32f407ZG board.
https://rusefi.com/forum/viewtopic.php?p=42498#p42498

Re: Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 3:41 pm
by opelpanfan
Ok. I'll keep in mind when going to assemble second board. Have 437zg and 469zi MCU. But for now will it still work on 407?

Re: Can not set trigger pins after compiling custom firmware.

Posted: Thu Oct 07, 2021 3:45 pm
by AndreyB
Yes.